node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »

when-node-promisify

when-node-promisify

transform when#promise from node style function.

when

 
  var promisify = require('when-node-promisify')
    , somePromiseFunc = promisify(someAsyncFunc)
    ;
 
  function someAsyncFunc(data, next) {
    // ... 
    next(null, data);
  }
 
  somePromiseFunc(1).then(function (data) {
     // success 
  }, function (err) {
     // err 
  });