Package Exports
- p-every
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (p-every) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
p-every 
Test whether all promises passes a testing function
Like Array.every for promises.
Install
$ npm install --save p-everyUsage
const pEvery = require('p-every');
const getContinent = require('get-continent'); // not a real module
const places = [
getCapital('Norway').then(info => info.name),
'Bangkok, Thailand',
'Berlin, Germany',
'Tokyo, Japan'
];
const filterer = x => getContinent(x).then(x => x === 'europe');
pEvery(places, filterer).then(result => {
console.log(result);
//=> false
});API
pFilter(input, filterer, [options])
Returns a Promise that is fulfilled when all promises in input and ones returned from filterer are fulfilled, or rejects if any of the promises reject. The fulfilled value is a boolean that is true if all Promises passed the test and false otherwise.
input
Type: Iterable<Promise|any>
Iterated over concurrently in the filterer function.
filterer(element, index)
Type: Function
Expected to return a Promise<boolean> or boolean.
options
Type: Object
concurrency
Type: number
Default: Infinity
Minimum: 1
Number of concurrently pending promises returned by filterer.
Related
- p-filter - Filter promises concurrently
- p-locate - Get the first fulfilled promise that satisfies the provided testing function
- p-map - Map over promises concurrently
- More…
License
MIT © Kevin Martensson