Refactor move docs (#8108)

* feat: [skip] generate readme script

* docs: [skip ci] update READMEs

* docs: [skip ci] fix code block type

* chore: [skip ci] move generator script
This commit is contained in:
Sven SAULEAU
2018-06-04 16:32:39 +02:00
committed by Henry Zhu
parent b6eaaa2496
commit b445b79734
143 changed files with 1286 additions and 11238 deletions

View File

@@ -1,57 +1,19 @@
# @babel/plugin-syntax-async-generators
> Allow parsing of async generator functions.
> Allow parsing of async generator functions
## Example
See our website [@babel/plugin-syntax-async-generators](https://new.babeljs.io/docs/en/next/babel-plugin-syntax-async-generators.html) for more information.
**Syntax**
## Install
```javascript
async function* agf() {
await 1;
}
```
```js
async function f() {
for await (let x of y) {
g(x);
}
}
```
## Installation
Using npm:
```sh
npm install --save-dev @babel/plugin-syntax-async-generators
npm install --save @babel/plugin-syntax-async-generators
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["@babel/plugin-syntax-async-generators"]
}
```
### Via CLI
or using yarn:
```sh
babel --plugins @babel/plugin-syntax-async-generators script.js
yarn add --save @babel/plugin-syntax-async-generators
```
### Via Node API
```javascript
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-syntax-async-generators"]
});
```
## References
* [Proposal: Asynchronous iteration for ECMAScript](https://github.com/tc39/proposal-async-iteration)