babel-preset-latest-node
babel preset latest for node 11 (Current), node 10 (Active LTS) node 8 (Maintenance LTS April 2019) or node 6 (EOL April 2019)
Last updated 7 months ago by churpeau .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install babel-preset-latest-node 
SYNC missed versions from official npm registry.

babel-preset-latest-node

babel preset latest for node 11 (Current), node 10 (Active LTS) node 8 (Maintenance LTS April 2019) or node 6 (EOL April 2019)

babel 7

Since v2, this package requires @babel/core@^7.0.0. If you use babel 6, you can still use the version "1.0.0" of this package. If you want to migrate, you can read the announcement and the official migration guide.

Alternatives

Options

  • target: 6, 6.5, 8, 8.3, 10, 11 or 'current' (process.versions.node)
  • loose: Enable “loose” transformations for any plugins in this preset that allow them (Disabled by default).
  • modules - Enable transformation of ES6 module syntax to another module type (Enabled by default to "commonjs"). Can be false to not transform modules, or "commonjs"
  • es2016 - Enable es2016 features (Enabled by default)
  • es2017 - Enable es2017 features (Enabled by default)
  • es2018 - Enable es2018 features (Enabled by default)
  • es2019 - Enable es2019 features (Enabled by default)
  • shippedProposals - Enable features in stages but already available in recent node version (Enabled by default)

Compatibility Table

Feature Node 6 Node 6.5 Node 8 Node 8.3 Node 10 Node 10.13 Node 11

ES2015

transform-modules-commonjs no no no no flag flag flag
transform-function-name flag yes yes yes yes yes yes

ES2016

transform-exponentiation-operator no flag yes yes yes yes yes

ES2017

transform-async-to-generator no no yes yes yes yes yes

ES2018

proposal-object-rest-spread no no flag yes yes yes yes
proposal-unicode-property-regex no no no flag yes yes yes
proposal-async-generator-functions no no no no yes yes yes

ES2019

syntax-optional-catch-binding no no no no flag yes yes

Shipped Proposals

syntax-json-strings no no no no yes yes yes

Install

npm install --save-dev @babel/core babel-preset-latest-node
yarn add --dev @babel/core babel-preset-latest-node

Usage

Via .babelrc

.babelrc

{
  "presets": ["latest-node"]
}
{
  "presets": [["latest-node", { "target": "current" }]]
}

Via CLI

babel script.js --presets latest-node

Via Node API

require("babel-core").transform("code", {
  presets: [require('babel-preset-latest-node')]
});
require("babel-core").transform("code", {
  presets: [[require('babel-preset-latest-node'), { target: 'current' }]]
});

Current Tags

  • 3.2.1                                ...           latest (7 months ago)
  • 2.0.0-beta.3                                ...           next (2 years ago)

20 Versions

  • 3.2.1                                ...           7 months ago
  • 3.2.0                                ...           7 months ago
  • 3.1.1                                ...           9 months ago
  • 3.1.0                                ...           9 months ago
  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0-beta.3                                ...           2 years ago
  • 2.0.0-beta.2                                ...           2 years ago
  • 2.0.0-beta.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.2                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 10
This Month 149
Last Day 10
Last Week 119
Last Month 246

Copyright 2014 - 2016 © taobao.org |