
Product
Introducing Custom Tabs for Org Alerts
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.
An ES6-developed functional API that prevents long-running scripts from blocking the JavaScript thread.
This is an API for getting long-running JavaScripts to periodically unblock the thread. The idea is to use timeouts to chunk up work and let the call stack unwind.
$ npm install --save chunkify
Import the module:
import chunkify from 'chunkify'
In API methods, an optional options object may provide any subset of the following data:
chunk: the number times to successively invoke fn before yielding control of the main thread.
1chunksizedelay: the minimal time in milliseconds to wait before continuing to invoke fn.
0yield, yieldtime, delaytimescope: the object on which fn is invoked on.
nullNumber, Boolean, or undefinedfn is invoked on successive array elements and their indices (fn(item, index)).
Returns a Promise that resolves with undefined when fn has been invoked on all items in array.
Identical to chunkify.each, except the returned Promise resolves with the array mapped by fn.
Exactly like the native reduce on Array.prototype, but the work is chunked up as above, and the returned promise resolves with the result of the reduction.
If any invocation of fn throws an Error, the returned promise is rejected with an object {error, item, index}, where error is the caught Error, index is the index in array where the invocation threw, and item is array[index]. No further processing happens after the failure.
Invoke fn in chunks from the range options.start to final. If options.start is given, it must be a Number less than or equal to final. Its default value is 0.
Like chunkify.range, with options.start forced to 0.
If any invocation of fn throws an Error, the promise is rejected with an object {error, index}, where error is the caught Error and index is the index in array where the invocation threw. No further processing happens after the failure.
Development is in snake_case ES6.
Get the source.
$ git clone git@github.com:yangmillstheory/chunkify
Install dependencies.
$ npm install
Compile sources.
$ node_modules/.bin/gulp
Run tests.
$ npm test
MIT © 2015, Victor Alvarez
FAQs
Split an iterable into evenly sized chunks
The npm package chunkify receives a total of 9,129 weekly downloads. As such, chunkify popularity was classified as popular.
We found that chunkify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.