Skip to content

reactgular/chunks

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published