tiny-filter-async
Async filter function, similar to (and inspired by) async.filter.
Usage
filter(array, iterator, callback)
Returns a new array of values (in the same order as the original array) which passed the async test. The iterator callback takes a single boolean argument (no error argument first).
Arguments:
array
- The array to iterate overiterator(item, callback)
- The function that does the actual filtering. The callback needs to be called with a boolean argument (callback(hasPassedTest)
).callback
- Called after all theiterator
functions have finished.
Example
var filter = ; ;
Benchmarks
Run the command below to see how it compares with other similar libraries from a performance standpoint.
npm run bench
Why the name?
Other possible names were already taken, and the actual source code is tiny.