Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including babel-plugin-transform-es2015-parameters with all npm packages installed. Try it out:

var babelPluginTransformEs2015Parameters = require("babel-plugin-transform-es2015-parameters")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

babel-plugin-transform-es2015-parameters v6.24.1

Compile ES2015 default and rest parameters to ES5

babel-plugin-transform-es2015-parameters

Compile ES2015 default and rest parameters to ES5

This plugin transforms ES2015 parameters to ES5, this includes:

  • Destructuring parameters
  • Default parameters
  • Rest parameters

Installation

npm install --save-dev babel-plugin-transform-es2015-parameters

Caveats

Default parameters desugar into let declarations to retain proper semantics. If this is not supported in your environment then you'll need the transform-block-scoping plugin.

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-es2015-parameters"]
}

Via CLI

babel --plugins transform-es2015-parameters script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-es2015-parameters"]
});
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free