babelee
v1.0.0
Published
Babel preset generator based on user-agent string.
Downloads
3
Readme
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.
- Feature detection is reference to ECMAScript 6 compatibility table
- No polyfills included. Use Polyfills as a Service or/and Babel polyfill if needed.
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