Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

promise-filter

yoshuawuyts100MIT1.1.0

Filter an array and return a Promise

bluebird, filter, native, promise

readme

promise-filter

NPM version build status Test coverage Downloads

Filter an array and return a Promise.

Installation

$ npm install promise-filter

Usage

const filter = require('promise-filter')

Promise.resolve([1, 2, 3])
  .then(filter((val) => val >= 2))
// => [2, 3]

Why?

This module is basically equivalent to bluebird.filter, but it's handy to have the one function you need instead of a kitchen sink. Modularity! Especially handy if you're serving to the browser and need to reduce your javascript bundle size.

Works great in the browser with browserify!

See Also

License

MIT