babel/packages/babel-plugin-transform-async-to-generator
Erik Desjardins 84af53d356 Async function will be hoisted above some imports
...but it's still below `exports.foo = undefined;`, so the test is intact
2016-02-03 12:11:14 -05:00
..
2015-10-29 17:51:24 +00:00
2016-01-20 00:58:48 -08:00
2015-09-15 06:12:46 +01:00

babel-plugin-transform-async-to-generator

Turn async functions into ES2015 generators

Installation

$ npm install babel-plugin-transform-async-to-generator

Usage

.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"]
});