Skip to content

Instantly share code, notes, and snippets.

@musukvl
Created January 14, 2019 18:28
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 musukvl/1b4d68cdb655470f255a0b3999f82b23 to your computer and use it in GitHub Desktop.
Save musukvl/1b4d68cdb655470f255a0b3999f82b23 to your computer and use it in GitHub Desktop.
Async context for your cli tools
function timeout(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
let result = (async function() {
await timeout(3000);
console.log("done");
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment