Skip to content

Instantly share code, notes, and snippets.

@vitkarpov
Last active November 11, 2017 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitkarpov/0e5f377c39f77d0f9f227bedad70f441 to your computer and use it in GitHub Desktop.
Save vitkarpov/0e5f377c39f77d0f9f227bedad70f441 to your computer and use it in GitHub Desktop.
Example of util.callbackify
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