babel/packages/babel-plugin-syntax-async-generators
2016-11-29 08:39:23 -05:00
..
2015-10-29 17:51:24 +00:00
2015-10-30 23:45:42 +00:00
2016-08-04 19:34:51 -04:00

babel-plugin-syntax-async-generators

Allow parsing of async generator functions.

Example

Syntax

async function* agf() {
  await 1;
}
async function f() {
  for await (let x of y) {
    g(x);
  }
}

Installation

npm install babel-plugin-syntax-async-generators

Usage

.babelrc

{
  "plugins": ["syntax-async-generators"]
}

Via CLI

babel --plugins syntax-async-generators script.js

Via Node API

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

References