chunkd
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

chunkd

Get a chunk of an array based on the total number of chunks and current index

Install

yarn add [--dev] chunkd

Example

const chunkd = require("chunkd")
 
chunkd([1, 2, 3, 4], 0, 3) // [1, 2]
chunkd([1, 2, 3, 4], 1, 3) // [3]
chunkd([1, 2, 3, 4], 2, 3) // [4]

/chunkd/

    Package Sidebar

    Install

    npm i chunkd

    Weekly Downloads

    240,277

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    3.82 kB

    Total Files

    7

    Last publish

    Collaborators

    • thejameskyle