npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

babel-plugin-transform-es5-property-mutators

6.24.1 • Public • Published

babel-plugin-transform-es5-property-mutators

This plugin allows Babel to transform object initializer mutators into Object.defineProperties.

Example

In

var foo = {
  get bar() {
    return "bar";
  }
};

Out

var foo = Object.defineProperties({}, {
  bar: {
    get: function () {
      return "bar";
    },
    enumerable: true,
    configurable: true
  }
});

Installation

npm install --save-dev babel-plugin-transform-es5-property-mutators

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-es5-property-mutators"]
}

Via CLI

babel --plugins transform-es5-property-mutators script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-es5-property-mutators"]
});

Keywords

install

npm i babel-plugin-transform-es5-property-mutators

Downloadsweekly downloads

13,105

version

6.24.1

license

MIT

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability