array-generators
Array methods (forEach, forEachSeries, map, filter) with support for generator functions.
Installation
$ npm install array-generators --save
Usage
let array = require('array-generators');
let forEach = array.forEach;
let filter = array.filter;
let map = array.map;
let arr = ['first', 'second', 'third'];
yield forEach(arr, function * (item, index) {
});
yield forEachSeries(arr, function * (item, index) {
});
let result = yield filter(arr, function * (item, index) {
});
let result = yield map(arr, function * (item, index) {
});
Tests
$ make test
License
MIT © Vadym Demedes