Socket
Socket
Sign inDemoInstall

babel-preset-node-module

Package Overview
Dependencies
96
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-preset-node-module

Babel preset used by Modern Node


Version published
Weekly downloads
10
decreased by-33.33%
Maintainers
1
Install size
6.75 MB
Created
Weekly downloads
 

Readme

Source

babel-preset-node-module

This package includes the Babel preset used by Modern Node. It includes:

  • babel-preset-latest for production
  • babel-preset-env for testing (an "autoprefixer" for babel-preset-latest)
  • babel-preset-react (for JSX and flow)
  • babel-plugin-transform-class-properties (class { handleClick = () => { } })
  • babel-plugin-transform-object-rest-spread (let n = { x, y, ...z };)

Usage

After installing babel, you can install this package as a dependency:

npm install --save-dev babel-preset-node-module

And configure Babel to use it by editing .babelrc:

{
  "presets": ["node-module"]
}

Options

  • targets - an object of browsers/environment versions to support.
  • browsers (array/string) - an query to select browsers (ex: last 2 versions, > 5%).

See babel-preset-env for details description of these options.

It defaults to current node version in development and test environment. For production babel-preset-latest is used.

  • loose (boolean) - Enable "loose" transformations
  • modules - Enable transformation of ES6 module syntax to another module type (Enabled by default to "commonjs").
    • Can be false to not transform modules, or one of ["amd", "umd", "systemjs", "commonjs"].
  • debug (boolean) - console.log out the targets and plugins being

Example:

{
  "presets": [
    ["node-module", {
      "targets": {
        "chrome": 52,
        "browsers": "last 2 safari versions"
      },
      "loose": true,
      "modules": false
    }]
  ]
}

FAQs

Last updated on 27 Sep 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc