Created
October 22, 2016 08:19
-
-
Save YutaroSoejima/d90c8ba3cfab614d6491d5c15897ebc5 to your computer and use it in GitHub Desktop.
Node.js v7 で async/awaitを試してみる ref: http://qiita.com/yutarosoejima/items/4155c59055e86bdf7a96
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
const wait = (delay) => { | |
return new Promise(resolve => setTimeout(resolve, delay)); | |
} | |
async function tryWaitFunction () { | |
console.log('スタート') | |
await wait(1000); | |
console.log('途中') | |
await wait(1000); | |
console.log('終わり') | |
} | |
tryWaitFunction(); |
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
nvm install 7 |
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
nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local/Cellar/nvm/0.31.2/versions/node/v7.0.0-nightly20161020d62e7bd1f9" | |
Run `npm config delete prefix` or `nvm use --delete-prefix v7.0.0-nightly20161020d62e7bd1f9` to unset it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment