Test each value in an array with every and return a Promise.
$ npm install promise-every
const every = require('promise-every')
Promise.resolve(['bin', 'baz', 123])
.then(every((val) => 'string' == typeof val))
// => false
This module is basically equivalent to Array.every
. It's packaged as a
single module because 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!