babel-preset-eslatest-node6

1.0.1 • Public • Published

babel-preset-eslatest-node6

Build Status

Babel preset to make Node v6 fully compatible with the latest ECMAScript specification. This includes all finished proposals but not stage 0 to 3 proposals.

It intentionally won't compile things that are already natively supported by Node v6.

Included plugins

Missing features

For Object.values/Object.entries, String padding or Object.getOwnPropertyDescriptors support, use babel-polyfill or transform-runtime.

Install

npm install --save-dev babel-preset-eslatest-node6

Usage

Via .babelrc (recommended)

.babelrc

{
  "presets": ["eslatest-node6"]
}

Note: if you are using object rest/spread, you will need to add a few additional plugins to make it work:

npm install --save-dev \
  babel-plugin-transform-es2015-destructuring \
  babel-plugin-transform-es2015-parameters \
  babel-plugin-transform-object-rest-spread
{
  "presets": ["eslatest-node6"],
  "plugins": [
    "transform-es2015-destructuring",
    "transform-es2015-parameters",
    ["transform-object-rest-spread", { "useBuiltIns": true }]
  ]
}

Via CLI

babel script.js --presets eslatest-node6

Via Node API

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

Options

  • loose - Enable "loose" transformations for any plugins in this preset that allow them (disabled by default).
{
  "presets": [
    ["eslatest-node6", { "loose": true }]
  ]
}

Credits

Inspired by babel-preset-es2015-node6

Dependents (7)

Package Sidebar

Install

npm i babel-preset-eslatest-node6

Weekly Downloads

42

Version

1.0.1

License

MIT

Last publish

Collaborators

  • olalonde