js-chunked-array
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

js-chunked-array

This creates an iterable wrapper for an Array or Array-like object.
The Chunks are not generated on initialisation, but are available through the iterator.
Usage:

const chunked = new ChunkedArray(originalArray, sizeOfChunks);
chunked.next() // { value: first chunk, done: true when no chunks left}

The chunkedArray is iterable and can be used in for..of or with the ... spread operator

for (let chunk in chunked) {
    // do sometihng with each chunk
}
const allChunks = [...chunked];

Readme

Keywords

none

Package Sidebar

Install

npm i js-chunked-array

Weekly Downloads

0

Version

0.1.0

License

Unlicense

Unpacked Size

14.8 kB

Total Files

16

Last publish

Collaborators

  • fabiandarga