promise-all-recursive
like
Promise.all()
, but for any type and recursive.
returns a promise that resolves when all promises in a recursive object-structure are resolved.
It doesn't try to do anything with rejected promises, so that is up to you.
installation
npm install promise-all-recursive
usage
const promiseAllRecursive = ; const object = number: 42 string: 'something' promise: Promise nested: promise: Promise array: 1 2 Promise deepNested: anotherPromise: Promise ;
will print:
number: 42 string: 'something' promise: 'this could have been from the network' nested: promise: '...or the filesystem' array: 1 2 3 deepNested: anotherPromise: 'sure!'
see test/test.js
for more examples.