File tree Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Original file line number Diff line number Diff line change @@ -10,29 +10,6 @@ $ npm i koa
1010$ node my-koa-app.js
1111```
1212
13- ## Async Functions with Babel
14-
15- To use ` async ` functions in Koa in versions of node < 7.6, we recommend using [ babel's require hook] ( http://babeljs.io/docs/usage/babel-register/ ) .
16-
17- ``` js
18- require (' babel-register' );
19- // require the rest of the app that needs to be transpiled after the hook
20- const app = require (' ./app' );
21- ```
22-
23- To parse and transpile async functions,
24- you should at a minimum have the [ transform-async-to-generator] ( http://babeljs.io/docs/plugins/transform-async-to-generator/ )
25- or [ transform-async-to-module-method] ( http://babeljs.io/docs/plugins/transform-async-to-module-method/ ) plugins.
26- For example, in your ` .babelrc ` file, you should have:
27-
28- ``` json
29- {
30- "plugins" : [" transform-async-to-generator" ]
31- }
32- ```
33-
34- You can also use the [ env preset] ( http://babeljs.io/docs/plugins/preset-env/ ) with a target option ` "node": "current" ` instead.
35-
3613# Application
3714
3815 A Koa application is an object containing an array of middleware functions
You can’t perform that action at this time.
0 commit comments