@59naga/babel-plugin-transform-array-from

replace `Array.from` with an ponyfill function

Stats

StarsIssuesVersionUpdatedCreatedSize
@59naga/babel-plugin-transform-array-from
200.0.06 years ago6 years agoMinified + gzip package size for @59naga/babel-plugin-transform-array-from in KB

Readme

babel-plugin-transform-array-from

Replace Array.from with an ponyfill function.

Installation

npm install @59naga/babel-plugin-transform-array-from --save

Example

In

Array.from('👺');

Out

var _arrayFrom = Array.from || function(){...};
_arrayFrom('👺');

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["@59naga/babel-plugin-transform-array-from"]
}

Via CLI

$ babel --plugins @59naga/babel-plugin-transform-array-from script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["@59naga/babel-plugin-transform-array-from"]
});

Development

Requirement global

  • NodeJS v0.12.13
  • Npm v3.7.1
git clone https://github.com/59naga/@59naga/babel-plugin-transform-array-from
cd @59naga/babel-plugin-transform-array-from
npm install

npm test

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.