n2p

0.0.2 • Public • Published

n2p - node-style callback to promise

Usage

var n2p = require('n2p');
 
async function foo() {
  return await n2p(function(cb) {
    fs.readFile('foo.txt', cb)
  })
}

Or in livescript (with the async syntax)

require! n2p
 
foo = ->>
  return await n2p -> fs.readFile('foo.txt', it)

Licence

MIT

Credits

By Geza Kovacs

/n2p/

    Package Sidebar

    Install

    npm i n2p

    Weekly Downloads

    1

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • geza