Node.js 7.x异步/等待支持演示-Node.js开发

  • d4_457722
    了解作者
  • 2.7KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-23 12:32
    上传日期
Node.js v7 async / await演示这是什么? Node.js v7.xx附带实验性的异步/等待支持,大大简化了编写现代服务器端代码所需的样板。 该项目是Node.js v7 async / await演示的演示。这是什么? Node.js v7.xx附带实验性的异步/等待支持,大大简化了编写现代服务器端代码所需的样板。 此项目是为了在Node中使用新的异步/等待功能而进行的最小设置的演示。 注意:目前,Node.js v7.x中尚未正式支持async / await。 欢迎您尝试一下,但是如果遇到错误,可能会不提供任何支持。 Node.js v7-简单设置(推荐)
node-v7-async-await-demo-master.zip
  • node-v7-async-await-demo-master
  • README.md
    1.3KB
  • .gitignore
    657B
  • index.js
    967B
  • package.json
    394B
内容介绍
## Node.js v7 async/await demo ### What is this? Node.js v7.x.x ships with experimental async/await support, greatly simplifying boilerplate required for writing modern server side code. This project is a demonstration of the minimal setup in order to use the new async/await features in Node. NOTE: async/await are not officially supported in Node.js v7.x at this point. You are welcome to try things out, but there may be no support if you encounter bugs. ### Node.js v7 - simple setup (recommended) Download and install node.js v7 release version for your platform from https://nodejs.org ``` https://nodejs.org ``` ### Node.js v7 - setup using node version manager (nvm) Go to http://nvm.sh and follow the instructions on installing nvm for your platform. Afterwards, run: ``` nvm install 7 nvm use 7 ``` ### Run the demo Currently async / await support ships under --harmony-async-await flag. npm start command executes `node --harmony-async-await index.js` ``` npm install npm start ``` ### What does not work While async/await is a great addition, some things like ES6 module support (`import x from 'x'`) and arrow function support in class declaration (`class A { b() => {} }`) are still not supported. If you use these features you might still want to keep a ES6/ES7 -> ES5 transpiler like Babel.
评论
    相关推荐