Socket
Book a DemoInstallSign in
Socket

babelee

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babelee

Babel preset generator based on user-agent string.

1.0.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

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

Keywords

babel

FAQs

Package last updated on 04 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.