UNPKG

flow-bro

Version:

Your personal flow type helper with features like coverage and watch mode

12 lines (10 loc) 251 B
module.exports = function toPromise(fn, ...args) { return new Promise((resolve, reject) => { fn(...args, (error, stdout, stderr) => { if (error) { reject({ error, stdout, stderr }); } resolve(stdout); }); }); };