callbox
v1.0.0
Published
Simple encapsulation utility for your callback code
Downloads
3
Maintainers
Readme
callbox
Simple encapsulation utility for your callback code.
Usage
var callbox = require('callbox')
var fs = require('fs')
async function main () {
var result = await callbox(done => {
fs.writeFile('hello', 'world', 'utf8', err => {
if (err) return done(err)
fs.readFile('hello', 'utf8', done)
})
})
console.log(result) // 'world'
}
main()
License
Apache-2.0