All Projects → sindresorhus → Chunkify

sindresorhus / Chunkify

Licence: mit
Split an iterable into evenly sized chunks

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Chunkify

Negative Array
Negative array index support `array[-1]` using ES2015 Proxy
Stars: ✭ 420 (+233.33%)
Mutual labels:  array, npm-package
Example Rollup React Component Npm Package
Example React Component, Published to npm
Stars: ✭ 122 (-3.17%)
Mutual labels:  npm-package
Faltu
Search sort, filter, limit an array of objects in Mongo-style.
Stars: ✭ 112 (-11.11%)
Mutual labels:  array
Doge Seed Cli
Generate dank mnemonic seed phrases in the terminal
Stars: ✭ 118 (-6.35%)
Mutual labels:  npm-package
Node Rus Diff
JSON diff
Stars: ✭ 112 (-11.11%)
Mutual labels:  npm-package
Php Server
Start a PHP server
Stars: ✭ 119 (-5.56%)
Mutual labels:  npm-package
P Queue
Promise queue with concurrency control
Stars: ✭ 1,863 (+1378.57%)
Mutual labels:  npm-package
React Ckeditor
CKEditor component for React with plugin and custom event listeners support
Stars: ✭ 124 (-1.59%)
Mutual labels:  npm-package
React Use Localstorage
(seeking maintainers) ⚓ React hook for using local storage
Stars: ✭ 122 (-3.17%)
Mutual labels:  npm-package
Teenyicons
Tiny minimal 1px icons designed to fit in the smallest places.
Stars: ✭ 1,631 (+1194.44%)
Mutual labels:  npm-package
Interviewbit
InterviewBit Solutions
Stars: ✭ 117 (-7.14%)
Mutual labels:  array
Bloc.js
A predictable state management library that helps implement the BLoC design pattern in JavaScript
Stars: ✭ 111 (-11.9%)
Mutual labels:  npm-package
Update Notifier
The idea for this module came from the desire to apply the browser update strategy to CLI tools, where everyone is always on the latest version. We first tried automatic updating, which we discovered wasn't popular. This is the second iteration of that idea, but limited to just update notifications.
Stars: ✭ 1,594 (+1165.08%)
Mutual labels:  npm-package
Containers
Containers backed by std.experimental.allocator
Stars: ✭ 111 (-11.9%)
Mutual labels:  array
Ink Gradient
Gradient color component for Ink
Stars: ✭ 123 (-2.38%)
Mutual labels:  npm-package
Hermes
Client-side messaging channel for sending data from one browser tab to another
Stars: ✭ 111 (-11.9%)
Mutual labels:  npm-package
Wordup Cli
Wordup is a fully integrated development platform for WordPress. Develop plugins and themes locally. Preview in the cloud. Automatic updates in WP.
Stars: ✭ 116 (-7.94%)
Mutual labels:  npm-package
Getme
CLI utility for everyday tasks. With getme you get weather, forecast, currency rate, upload files, IP address, word definitions, text translations, internet speed, do google searches, get inspirational quotes and get Chuck Norris jokes
Stars: ✭ 118 (-6.35%)
Mutual labels:  npm-package
Containers
This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.
Stars: ✭ 125 (-0.79%)
Mutual labels:  array
Svgurt
Image -> SVG Vectorizing Tool - Live at:
Stars: ✭ 124 (-1.59%)
Mutual labels:  npm-package

chunkify

Split an iterable into evenly sized chunks

Install

$ npm install @sindresorhus/chunkify

Usage

import chunkify from '@sindresorhus/chunkify';

console.log([...chunkify([1, 2, 3, 4], 2)]);
//=> [[1, 2], [3, 4]]

console.log([...chunkify([1, 2, 3, 4], 3)]);
//=> [[1, 2, 3], [4]]

API

chunkify(iterable, chunkSize)

Returns an iterable with the chunks. The last chunk could be smaller.

iterable

Type: Iterable (for example, Array)

The iterable to chunkify.

chunkSize

Type: number (integer)
Minimum: 1

The size of the chunks.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].