1. babel-preset-es2015-node4
Babel preset to make node@4 ES2015 compatible.
babel-preset-es2015-node4
Package: babel-preset-es2015-node4
Created by: jbach
Last modified: Mon, 13 Jun 2022 04:06:17 GMT
Version: 2.1.1
License: MIT
Downloads: 5,693
Repository: https://github.com/jbach/babel-preset-es2015-node4

Install

npm install babel-preset-es2015-node4
yarn add babel-preset-es2015-node4

babel-preset-es2015-node4 (DEPRECATED)

Babel preset to make node@4 ES2015 compatible.

DEPRECATED: Use the awesome babel-preset-env!

Node@4 has great ES2015 support,
this module just adds missing features:

  • destructing assignment
  • rest & default parameters
  • modules
  • unicode and sticky regular expressions
  • spread operator
  • function.name

Does not include regenerator!

You can not blacklist plugins in babel@6. To avoid cruft, this preset does not include full Generators support via regenerator.

If you rely on %GeneratorPrototype%.return, yield *, iterator closing or yield *, iterator closing via throw() (see compat table), you will have to npm install and include regenerator yourself:

 {
	"presets": ["es2015-node4"],
	"plugins": ["transform-regenerator"]
}

Install

 $ npm install --save-dev babel-preset-es2015-node4

Usage

Via .babelrc (recommended)

.babelrc

 {
  "presets": ["es2015-node4"]
}

Via CLI

 $ babel script.js --preset es2015-node4

Via Node API

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

License

MIT

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code