Created
January 14, 2019 18:28
-
-
Save musukvl/1b4d68cdb655470f255a0b3999f82b23 to your computer and use it in GitHub Desktop.
Async context for your cli tools
This file contains 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
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