node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org ยป

when-promisify

when-promisify

Make any node-style callback function return a promise instead.
when-promisify supports two ways to promisify a callback function.

  1. simple way: just pass a function

    var promisify = require('when-promisify')
    var promise = promisify( cbFunction )
    
  2. pass a function with its context

    var promisify = require('when-promisify')
    var promise = promisify( Object, 'methodName' )