# array-bounds

> Find [nd-]array min/max values

Latest version **1.0.1** (published 2017-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install array-bounds
pnpm add array-bounds
yarn add array-bounds
bun add array-bounds
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-06-08 |
| First published | 2017-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/array-bounds) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Dima Yv |
| Maintainers | dfcreative |
| Keywords | array, bounds, limits, array min, min, max, statistics, samples |

## Links

- npm: https://www.npmjs.com/package/array-bounds
- Repository: https://github.com/dfcreative/array-bounds
- Homepage: https://github.com/dfcreative/array-bounds#readme
- Issues: https://github.com/dfcreative/array-bounds/issues
- npm.io page: https://npm.io/package/array-bounds

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-06-08
- 1.0.0 — 2017-06-01

## README

# array-bounds  [![experimental](https://img.shields.io/badge/stability-unstable-yellow.svg)](http://github.com/badges/stability-badges) [![Build Status](https://img.shields.io/travis/dfcreative/array-bounds.svg)](https://travis-ci.org/dfcreative/array-bounds)

Find min and max values of a sequence of values/coordinates.

[![npm install array-bounds](https://nodei.co/npm/array-bounds.png?mini=true)](https://npmjs.org/package/array-bounds/)

```js
const getBounds = require('array-bounds')

let bounds = getBounds([0, 25, 50, 75, 100]) // [0, 100]
```

## API

### box = bounds(array, dim=1)

Figures out bounds of sequence of points using dimensions `dim` as stride, ie. for 1d values expected data layout is `[x, x, x, ...]` for 2d is `[x, y, x, y, ...]`, etc. Returned array contains bounds for every dimension as `[minX, minY, ..., maxX, maxY]`, eg.

```js
//get bounding box
let [minX, minY, maxX, maxY] = bounds([x1, y1, x2, y2, x3, y3, ...], 2)

//get bounding cube
let [minX, minY, minZ, maxX, maxY, maxZ] = bounds([x1, y1, z1, x2, y2, z2, ...], 3)
```

---
_Source: https://npm.io/package/array-bounds · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
