# @jswork/next-chunk

> Creates an array of elements split into groups the length of size.

Latest version **1.0.3** (published 2022-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jswork/next-chunk
pnpm add @jswork/next-chunk
yarn add @jswork/next-chunk
bun add @jswork/next-chunk
```

## 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.3 |
| Published | 2022-09-15 |
| First published | 2020-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | afei |
| Maintainers | afeiship |
| Keywords | next, chunk, each, slice, file, buffer, blob, each-slice |

## Links

- npm: https://www.npmjs.com/package/@jswork/next-chunk
- Homepage: https://github.com/afeiship/next-chunk
- npm.io page: https://npm.io/package/@jswork/next-chunk

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2022-09-15
- 1.0.2 — 2021-03-18
- 1.0.1 — 2021-03-17
- 1.0.0 — 2020-11-21

## README

# next-chunk
> Creates an array of elements split into groups the length of size.

[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]

## installation
```bash
npm install -S @jswork/next-chunk
```

## apis
| api      | type              | description         |
| -------- | ----------------- | ------------------- |
| nx.chunk | (inArray,inChunk) | Create split chunks |

## usage
```js
import '@jswork/next-chunk';

// array
const arr = [1,2,3,4,5,6,7,8];
const res = nx.chunk(arr, 3);
// result:
// [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8 ] ]


// buffer/file
const file =new File(["foobar"], "foo.txt", {
  type: "text/plain",
});

// result:
const res = nx.chunk(file, 2);
// [ Blob, Blob, Blob ] 
```

## license
Code released under [the MIT license](https://github.com/afeiship/next-chunk/blob/master/LICENSE.txt).

[version-image]: https://img.shields.io/npm/v/@jswork/next-chunk
[version-url]: https://npmjs.org/package/@jswork/next-chunk

[license-image]: https://img.shields.io/npm/l/@jswork/next-chunk
[license-url]: https://github.com/afeiship/next-chunk/blob/master/LICENSE.txt

[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-chunk
[size-url]: https://github.com/afeiship/next-chunk/blob/master/dist/next-chunk.min.js

[download-image]: https://img.shields.io/npm/dm/@jswork/next-chunk
[download-url]: https://www.npmjs.com/package/@jswork/next-chunk

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