1.0.0 • Published 8 years ago

babelee v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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