d1a8dea758eebaeaf476ffbf17da4670541ed2b7dcf9002e2254a6414d098ad0ae79f1c79d1e18ca469c3060fb3d6b1e419ca8e6c3079ac79413732bd2eff1 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # babel-plugin-transform-es2015-parameters
  2. > Compile ES2015 default and rest parameters to ES5
  3. This plugin transforms ES2015 parameters to ES5, this includes:
  4. - Destructuring parameters
  5. - Default parameters
  6. - Rest parameters
  7. ## Installation
  8. ```sh
  9. npm install --save-dev babel-plugin-transform-es2015-parameters
  10. ```
  11. ## Caveats
  12. Default parameters desugar into `let` declarations to retain proper semantics. If this is
  13. not supported in your environment then you'll need the
  14. [transform-block-scoping](http://babeljs.io/docs/plugins/transform-es2015-block-scoping) plugin.
  15. ## Usage
  16. ### Via `.babelrc` (Recommended)
  17. **.babelrc**
  18. ```json
  19. {
  20. "plugins": ["transform-es2015-parameters"]
  21. }
  22. ```
  23. ### Via CLI
  24. ```sh
  25. babel --plugins transform-es2015-parameters script.js
  26. ```
  27. ### Via Node API
  28. ```javascript
  29. require("babel-core").transform("code", {
  30. plugins: ["transform-es2015-parameters"]
  31. });
  32. ```