Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gerard2perez/babel-helper-remap-koa2-async-to-generator


https://github.com/gerard2perez/babel-helper-remap-koa2-async-to-generator

Last synced: 16 days ago
JSON representation

Awesome Lists containing this project

README

        

# babel-helper-remap-koa2-async-to-generator

Turn async functions into ES2015 generators (Koav2 -> Koav1).

## Installation

```sh
$ npm install babel-helper-remap-koa2-async-to-generator
```

## Usage
### Via `.babelrc` (Recommended)

**.babelrc**

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

### Via CLI

```sh
$ babel --plugins transform-koa2-async-to-generator script.js
```

### Via Node API

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