Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

babel-preset-koa2-node7

umayr15MIT0.1.0

Babel preset for Koa 2 running with node 7

babel, babel-preset, babel-preset-es2017, node7, koa2

readme

babel-preset-koa2-node7

Babel preset for koa2 running with node7.

Node@7 has already great ES2017 support, but there are few things still missing and this module adds them:

Note: This project is forked from tengattack/babel-preset-es2017-node7, as node 7 still has async/await behind a flag and its not production ready, so this module covers that up by adding transform-async-to-generator.

Install

$ npm install --save-dev babel-preset-koa2-node7

Usage

Read "Configuring Babel 6" article for more information about babel@6 configuration.

Node run

node script.js

.babelrc

{
  "presets": ["es2017-node7"]
}

Via CLI

babel script.js --presets es2017-node7

Via Node API

require('babel-core').transform('code', {
  presets: ['es2017-node7'],
})

Credits

License

MIT