1.6.0 • Published 6 years ago
greenmap v1.6.0
Greenmap
Map arrays asynchronously in separate threads. Powered by greenlet.
Greenmap supports only browsers, since greenlet relies on web workers.
Installation
npm i --save-dev greenmap
Usage
Pass an array and a map function to execute asynchronously in a separate thread.
await
result or use as a promise.
import { map } from 'greenmap';
async function mapArray() {
const result = await map([1, 2, 3], (item) => ++item);
console.log(result);
};
// [2, 3, 4]
mapArray();
Tests
npm test