# babel-preset-node7

> Babel preset for Node 7.x

Latest version **1.5.0** (published 2017-02-02) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install babel-preset-node7
pnpm add babel-preset-node7
yarn add babel-preset-node7
bun add babel-preset-node7
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2017-02-02 |
| First published | 2016-11-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lee Benson |
| Maintainers | leebenson |
| Keywords | babel-preset-node7, babel-preset, babel, node7, es2015, es6 |

## Links

- npm: https://www.npmjs.com/package/babel-preset-node7
- Repository: https://github.com/leebenson/babel-preset-node7
- Homepage: https://github.com/leebenson/babel-preset-node7#readme
- Issues: https://github.com/leebenson/babel-preset-node7/issues
- npm.io page: https://npm.io/package/babel-preset-node7

## Dependencies (5)

- [babel-plugin-syntax-async-functions](https://npm.io/package/babel-plugin-syntax-async-functions.md) ^6.13.0
- [babel-plugin-transform-class-properties](https://npm.io/package/babel-plugin-transform-class-properties.md) ^6.19.0
- [babel-plugin-transform-object-rest-spread](https://npm.io/package/babel-plugin-transform-object-rest-spread.md) ^6.19.0
- [babel-plugin-syntax-trailing-function-commas](https://npm.io/package/babel-plugin-syntax-trailing-function-commas.md) ^6.13.0
- [babel-plugin-transform-es2015-modules-commonjs](https://npm.io/package/babel-plugin-transform-es2015-modules-commonjs.md) ^6.18.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.5.0 (latest) — 2017-02-02
- 1.4.0 — 2016-11-21
- 1.3.0 — 2016-11-21
- 1.2.0 — 2016-11-04
- 1.1.0 — 2016-11-04
- 1.0.0 — 2016-11-04

## README

# Note: DEPRECATED.  Please use [babel-preset-env](https://github.com/babel/babel-preset-env) instead.

This package is no longer the recommended way to polyfill with Babel. The new best practice is to use [babel-preset-env](https://github.com/babel/babel-preset-env).

----------

# Babel 6.x presets for Node 7.x (updated regularly!)

Node 7.x brings ~99% [native ES6/ES2015 coverage](http://node.green/).

This preset for Babel 6 attempts to bridge the gap for the remaining 1%.

## Motivation

Babel 6.x is awesome, but simply including the [ES2015 preset](https://www.npmjs.com/package/babel-preset-es2015) means you're transpiling features
that your Node 5.x installation can already do faster and natively, replacing them with inferior / old code.

This preset complements existing V8-native functionality - it doesn't work _around_ it.

The end result is nearly always a faster build and script execution time.

## Key features:
* Removes trailing commas from function calls (via [babel-plugin-syntax-trailing-function-commas](https://www.npmjs.com/package/babel-plugin-syntax-trailing-function-commas))
* CommonJS import/export module syntax ([babel-plugin-transform-es2015-modules-commonjs](https://www.npmjs.com/package/babel-plugin-transform-es2015-modules-commonjs))
* ES7 class properties ([babel-plugin-transform-class-properties](https://www.npmjs.com/package/babel-plugin-transform-class-properties))
* Object rest spread ([babel-plugin-transform-object-rest-spread](https://www.npmjs.com/package/babel-plugin-transform-object-rest-spread))
* Async/await **syntax**. Note: This is *syntax recognition only*. It prevents babel from complaining when it encounters unfamiliar 'async' or 'await' keywords in your code. This does **not** transpile async/await into working functions. Instead, use the `--harmony-async-await` flag on Node start-up.

## Usage instructions

## Installation

Install via NPM the usual way:

`npm i babel-preset-node7`

## Usage

### Via `.babelrc` (recommended)

Create a `.babelrc` file in your project root, and include 'node7' in your preset path:

```js
{
  "presets": [
    "node7"
  ]
}
```

Now whenever you run `babel-node`, it will polyfill your app with the ES2015 features that Node is missing.

### Via CLI
`$ babel script.js --presets node7`

### Via Node API

If you don't want to use a project-wide `.babelrc` file (as above):

```js
require("babel-core").transform("code", {
  presets: ["node7"]
});
```

And if you _do_, and you want to use vanilla `node` instead of `babel-node` as your CLI, you can create an entry script that references your pre-transpiled code like so:

```js
require('babel-register');
require('path/to/es6/script');
```

... which will then run everywhere Node can.

Of course, make sure to `npm i -S babel-core` or `npm i -S babel-register` respectively, to grab the NPM packages you'll need to transpile on-the-fly.

### Webpack, Gulp, Browserify, etc

Follow vendor instructions and include `node7` in your babel "preset" list.

## How to add React support

Babel has a ready-made preset for React, and you now need to install it separately.

Just grab it via NPM:

`npm i babel-preset-react`

And then add it to your "presets" list in `.babelrc`:

```js
{
  "presets": [
    "node7",
    "react"
  ]
}
```

## How to use async/await

This preset does *not* ship with async/await transforms, because Node 7.x now supports them natively.

Simply pass the `--harmony-async-await` flag to Node on start-up.

---
_Source: https://npm.io/package/babel-preset-node7 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
