npm.io
0.1.1 • Published 8 years ago

runas-callback-to-promise

Licence
Apache-2.0
Version
0.1.1
Deps
0
Vulns
0
Weekly
0

Runas Callbacks to Promise

Library that allows to work with callbacks functions like if they were Promises.

Example:

const pctp = require('runas-callback-to-promise');

pctp.c2p(childProcess.exec, 'pwd')
  .then(stdout => {
    console.log(stdout);
  })
  .then(() => {...})
  .catch((error) => pctp.logError(error, cb));
});

Keywords