1.0.1 • Published 4 years ago

@reactgular/chunks v1.0.1

Weekly downloads
56
License
MIT
Repository
github
Last release
4 years ago

Build Status Coverage Status npm version

What is Chunks?

Chunks is a TypeScript library that creates an array of elements split into groups the length of size. If the array can't be split evenly, the final chunk can be optionally padded with a default value.

Installation

To get started, install the package from npm.

npm install --save @reactgular/chunks

Usage

Chunks is small, simple and easy to use.

import {chunks} from '@reactgular/chunks';

console.log(chunks([1,2,3,4,5],2))
// => [[1,2],[3,4],[5]]

console.log(chunks([1,2,3,4,5],2,undefined))
// => [[1,2],[3,4],[5,undefined]]

Getting help

You are welcome to open issues for general support questions as well as bug reports and feature requests.