PromiseCatch turns this:
Promise.all([
fs.readFileAsync('foo.jpg').catch(() => null),
fs.readFileAsync('bar.jpg').catch(() => null)
]);
Into this:
Promise.all(promiseCatch([
fs.readFileAsync('foo.jpg'),
fs.readFileAsync('bar.jpg')
], null));
Assuming fs.readFileAsync returns a Promise. This can be achieved with a promise library like Bluebird.
Calls to Promise.all and similar functions will fail at the first rejected promise. It is particularly useful to be able to avoid this when using generators to mimic the async/ await functionality of ES7.