babel-plugin-transform-jscript
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
.babelrc
(Recommended)
Via .babelrc
{
"plugins": ["transform-jscript"]
}
Via CLI
babel --plugins transform-jscript script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["transform-jscript"]
});