Skip to content

Instantly share code, notes, and snippets.

@craftgear
Last active October 27, 2017 04:32
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 craftgear/8802b482952d8f243a7160c97dcca1ed to your computer and use it in GitHub Desktop.
Save craftgear/8802b482952d8f243a7160c97dcca1ed to your computer and use it in GitHub Desktop.
async (callback) => {
const { err, ...result } = await asyncCode().catch(e => ({ err: e }));
if (err) {
callback(err);
return;
}
callback(null, result);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment