# array-pack-2d

> Quickly pack a nested 2D array into a typed array – useful for flattening point data into a WebGL-friendly format

Latest version **1.0.0** (published 2016-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install array-pack-2d
pnpm add array-pack-2d
yarn add array-pack-2d
bun add array-pack-2d
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-07-16 |
| First published | 2014-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Hugh Kennedy |
| Maintainers | hughsk |
| Keywords | array, 2d, pack, mesh, points, nested, flat |

## Links

- npm: https://www.npmjs.com/package/array-pack-2d
- Repository: https://github.com/hughsk/array-pack-2d
- Homepage: http://hughsk.github.io/array-pack-2d
- Issues: https://github.com/hughsk/array-pack-2d/issues
- npm.io page: https://npm.io/package/array-pack-2d

## Dependencies (1)

- [dtype](https://npm.io/package/dtype.md) ^2.0.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-07-16
- 0.1.1 — 2015-05-25
- 0.1.0 — 2014-04-21
- 0.0.1 — 2014-04-21
- 0.0.0 — 2014-04-21

## README

# array-pack-2d [![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #

Quickly pack a nested 2D array into a typed array – useful for flattening point data into a WebGL-friendly format.

## Usage ##

[![array-pack-2d](https://nodei.co/npm/array-pack-2d.png?mini=true)](https://nodei.co/npm/array-pack-2d)

### packed = pack(array, [type]) ###

Takes a nested 2D `array` and packs it into a flat, `packed` one. By default
this will be a `Float32Array`, but you can specify a custom `type` too: this
can be a constructor such as `Uint8Array`, or a
[dtype](http://github.com/shama/dtype) string such as `"float32"` or `"uint8"`.

## License ##

MIT. See [LICENSE.md](http://github.com/hughsk/array-pack-2d/blob/master/LICENSE.md) for details.

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