# chunk

> Chunk converts arrays like `[1,2,3,4,5]` into arrays of arrays like `[[1,2], [3,4], [5]]`.

Latest version **0.0.3** (published 2020-08-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install chunk
pnpm add chunk
yarn add chunk
bun add chunk
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2020-08-24 |
| First published | 2013-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/chunk) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Ryan Cole |
| Maintainers | ryancole |
| Keywords | array, chunk |

## Links

- npm: https://www.npmjs.com/package/chunk
- Repository: https://github.com/ryancole/chunk
- Homepage: https://github.com/ryancole/chunk#readme
- Issues: https://github.com/ryancole/chunk/issues
- npm.io page: https://npm.io/package/chunk

## Recent versions

- 0.0.3 (latest) — 2020-08-24
- 0.0.2 — 2014-10-06
- 0.0.1 — 2013-03-05

## README

![Build](https://github.com/ryancole/chunk/workflows/Build/badge.svg)
![Release](https://github.com/ryancole/chunk/workflows/Release/badge.svg)

Chunk converts arrays like `[1,2,3,4,5]` into arrays of arrays like `[[1,2], [3,4], [5]]`.

![Chunk, from The Goonies](http://i.imgur.com/T3WCUmu.jpg "Chunk, from The Goonies")

You can install chunk using npm ...

```
npm install chunk
```

or bower ...

```
bower install chunk
```

## Examples

To chunk an array into an array of smaller arrays, simply call chunk:

```javascript
> var chunk = require('chunk')
> chunk([1,2,3])
[ [ 1, 2 ], [ 3 ] ]

```

To chunk an array into an array of N-sized arrays, call chunk with N:

```javascript
> chunk([1,2,3], 1)
[ [ 1 ], [ 2 ], [ 3 ] ]
> chunk([1,2,3], 3)
[ [ 1, 2, 3 ] ]
``` 

The default chunk size is 2.

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