npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

babel-plugin-transform-jscript

6.22.0 • Public • Published

babel-plugin-transform-jscript

This plugin allows Babel to transform named function expressions into function declarations to get around some particularly nasty JScript bugs related to name function expressions.

Example

In

var foo = function bar() {
 
};

Out

"use strict";
 
var foo = (function () {
  function bar() {}
 
  return bar;
})();

Installation

npm install --save-dev babel-plugin-transform-jscript

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-jscript"]
}

Via CLI

babel --plugins transform-jscript script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-jscript"]
});

Keywords

install

npm i babel-plugin-transform-jscript

Downloadsweekly downloads

20,244

version

6.22.0

license

MIT

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability