Skip to content

Instantly share code, notes, and snippets.

@YutaroSoejima
Created October 22, 2016 08:19
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 YutaroSoejima/d90c8ba3cfab614d6491d5c15897ebc5 to your computer and use it in GitHub Desktop.
Save YutaroSoejima/d90c8ba3cfab614d6491d5c15897ebc5 to your computer and use it in GitHub Desktop.
Node.js v7 で async/awaitを試してみる ref: http://qiita.com/yutarosoejima/items/4155c59055e86bdf7a96
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();
nvm install 7
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