Skip to content

tengattack/babel-preset-es2017-node7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-preset-es2017-node7

Babel preset to make node@7 ES2017 compatible.

Node@7 has great ES2017 support, the most excited change is the support of async function in harmony flag, this module just adds missing features:

Install

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

Usage

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

Node run in harmony

# 7.6.0 > Node.js version > 7.0.0
node --harmony script.js
# Node.js version >= 7.6.0
node script.js

Via .babelrc (recommended)

.babelrc

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

If you are using webpack 2, this will help for import / export was natively supported in Webpack 2.

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

Via CLI

babel script.js --presets es2017-node7

Via Node API

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

Credits

License

MIT

About

Babel preset to make node@7 ES2017 compatible.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published