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]

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.1
    204,450
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.1
    204,450
  • 2.0.0
    16
  • 1.0.0
    31,746

Package Sidebar

Install

npm i chunkd

Weekly Downloads

236,212

Version

2.0.1

License

MIT

Unpacked Size

3.82 kB

Total Files

7

Last publish

Collaborators

  • thejameskyle