Last active
November 11, 2017 08:47
-
-
Save vitkarpov/0e5f377c39f77d0f9f227bedad70f441 to your computer and use it in GitHub Desktop.
Example of util.callbackify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { callbackify } = require('util'); | |
async function main() { | |
await Promise.resolve(); | |
} | |
callbackify(main)(function(err) { | |
if (err) { | |
return console.error(err); | |
} | |
console.log('finished without an error'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment