npm install n2p``javascript
var n2p = require('n2p');
async function foo() {
return await n2p(function(cb) {
fs.readFile('foo.txt', cb)
})
}
`
Or in livescript (with the async syntax)
`livescript
require! n2p
foo = ->>
return await n2p -> fs.readFile('foo.txt', it)
``
MIT
By Geza Kovacs