babelee

1.0.0 • Public • Published

babelee

Babel preset generator based on user-agent string. You can only transform the parts which are not supported by the specific browser to ES5 code.

Install

npm install --save babelee

Usage

var babel = require('babel-core')
var babelee = require('babelee')
 
var result = babel.transform('let max = (...n) => Math.max(...n);', {
  presets: [
    babelee('Mozilla/5.0 (Mac OS X 10.11; rv:38.0) Gecko/20100101 Firefox/38.0')
  ]
})
console.log(result.code)
/*
var max = function max() {        // arrow function is transformed
  return Math.max(...arguments);  // spread operator is not transformed
};
*/

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i babelee

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • gerhut