Code Monkey home page Code Monkey logo

async-await's Introduction

#####package.json依赖

  "devDependencies": {
    "babel-plugin-transform-runtime": "^6.8.0",
    "babel-plugin-syntax-async-functions": "^6.8.0",
    "babel-plugin-transform-regenerator": "^6.8.0",
    "babel-preset-es2015": "^6.8.0",
    "babel-runtime": "^6.8.0"
  }

#####安装依赖

npm install -g babel-cli
npm install

#####配置.babelrc

{
  "presets": ["es2015"],
  "plugins": ["syntax-async-functions","transform-regenerator","transform-runtime"]
}

#####运行npm start


``` 各依赖说明: babel-plugin-syntax-async-functions:允许babel解析async语法 babel-plugin-transform-regenerator:转换async和generator语法为通用js语法 babel-plugin-transform-runtime、babel-runtime: 省去引入babel-polyfill的麻烦 babel-preset-es2015:包含基本的plugins

babel-preset-es2015 包含的插件: check-es2015-constants transform-es2015-arrow-functions transform-es2015-block-scoped-functions transform-es2015-block-scoping transform-es2015-classes transform-es2015-computed-properties transform-es2015-destructuring transform-es2015-duplicate-keys transform-es2015-for-of transform-es2015-function-name transform-es2015-literals transform-es2015-modules-commonjs transform-es2015-object-super transform-es2015-parameters transform-es2015-shorthand-properties transform-es2015-spread transform-es2015-sticky-regex transform-es2015-template-literals transform-es2015-typeof-symbol transform-es2015-unicode-regex transform-regenerator

async-await's People

Contributors

singno avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.