async-functions-wrap
v0.0.2
Published
wrap your async function with catch.
Downloads
2
Readme
async-functions-wrap
wrap your async function with catch.
Usage
before
(async () => {
try {
await doSomething()
console.log('It\'s ok!')
} catch (err) {
console.error(err)
}
})()
after
const asyncWrap = require('async-functions-wrap')
asyncWrap(async () => {
await doSomething()
return 'It\'s ok!'
})