babelee
Babel preset generator based on user-agent string.
Last updated 4 years ago by gerhut .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install babelee 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (4 years ago)

1 Versions

  • 1.0.0                                ...           4 years ago

Copyright 2014 - 2017 © taobao.org |