babel-plugin-transform-async-to-generator
Turn async functions into ES2015 generators
Last updated 2 years ago by hzoo .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install babel-plugin-transform-async-to-generator 
SYNC missed versions from official npm registry.

babel-plugin-transform-async-to-generator

Turn async functions into ES2015 generators

Example

In

async function foo() {
  await bar();
}

Out

var _asyncToGenerator = function (fn) {
  ...
};
var foo = _asyncToGenerator(function* () {
  yield bar();
});

Installation

npm install --save-dev babel-plugin-transform-async-to-generator

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-async-to-generator"]
}

Via CLI

babel --plugins transform-async-to-generator script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-async-to-generator"]
});

References

Current Tags

  • 6.24.1                                ...           latest (2 years ago)
  • 7.0.0-beta.3                                ...           next (a year ago)

41 Versions

  • 7.0.0-beta.3                                ...           a year ago
  • 7.0.0-beta.2                                ...           a year ago
  • 7.0.0-beta.1                                ...           a year ago
  • 7.0.0-beta.0                                ...           a year ago
  • 7.0.0-alpha.20                                ...           a year ago
  • 7.0.0-alpha.19                                ...           a year ago
  • 7.0.0-alpha.18                                ...           a year ago
  • 7.0.0-alpha.17                                ...           a year ago
  • 7.0.0-alpha.16                                ...           a year ago
  • 7.0.0-alpha.15                                ...           a year ago
  • 7.0.0-alpha.14                                ...           a year ago
  • 7.0.0-alpha.12                                ...           a year ago
  • 7.0.0-alpha.11                                ...           a year ago
  • 7.0.0-alpha.10                                ...           a year ago
  • 7.0.0-alpha.9                                ...           2 years ago
  • 7.0.0-alpha.8                                ...           2 years ago
  • 6.24.1                                ...           2 years ago
  • 7.0.0-alpha.7                                ...           2 years ago
  • 7.0.0-alpha.3                                ...           2 years ago
  • 7.0.0-alpha.1                                ...           2 years ago
  • 6.22.0                                ...           2 years ago
  • 6.16.0                                ...           2 years ago
  • 6.8.0                                ...           3 years ago
  • 6.7.4                                ...           3 years ago
  • 6.7.0                                ...           3 years ago
  • 6.5.0-1                                ...           3 years ago
  • 6.5.0                                ...           3 years ago
  • 6.4.6                                ...           3 years ago
  • 6.4.5                                ...           3 years ago
  • 6.4.0                                ...           3 years ago
  • 6.3.13                                ...           3 years ago
  • 6.3.0                                ...           3 years ago
  • 6.2.4                                ...           3 years ago
  • 6.1.18                                ...           3 years ago
  • 6.1.17                                ...           3 years ago
  • 6.1.13                                ...           3 years ago
  • 6.1.10                                ...           3 years ago
  • 6.1.5                                ...           3 years ago
  • 6.1.4                                ...           3 years ago
  • 6.0.14                                ...           3 years ago
  • 6.0.2                                ...           3 years ago
Downloads
Today 4,368
This Week 16,015
This Month 89,993
Last Day 11,647
Last Week 54,288
Last Month 151,758
Dev Dependencies (1)
Dependents (709)

Copyright 2014 - 2016 © taobao.org |