{"name":"babel-plugin-transform-class-properties","version":"7.0.0-beta.2","description":"This plugin transforms static class properties as well as properties declared with the property initializer syntax","repository":{"type":"git","url":"https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-class-properties"},"license":"MIT","main":"lib/index.js","keywords":["babel-plugin"],"dependencies":{"babel-helper-function-name":"7.0.0-beta.2","babel-plugin-syntax-class-properties":"7.0.0-beta.2","babel-template":"7.0.0-beta.2"},"devDependencies":{"babel-helper-plugin-test-runner":"7.0.0-beta.2"},"_id":"babel-plugin-transform-class-properties@7.0.0-beta.2","_npmVersion":"5.4.1","_nodeVersion":"8.1.4","_npmUser":{"name":"hzoo","email":"hi@henryzoo.com"},"dist":{"integrity":"sha512-AKY8nX7Am8GiyYWc3Nayck2RDHOQeI4HyHyJOpXMnsRD6/aMV/mEhEq5lbIpvlJIhxA6Kyebs0wz4/bsB6HOAw==","shasum":"1c8d8c76531b52aab1849d6b791329b44413af2a","tarball":"http://registry-npm.ywwl.com/babel-plugin-transform-class-properties/download/babel-plugin-transform-class-properties-7.0.0-beta.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEL3h6yVXUlAVPRoX/gwHDqt8v/evhXEPq/FwPcDmXywAiEA/AFFwNeaUMYOPnFklIGE8+Ouz9GesxLzrD5pJfvpV4A="}],"size":3192,"noattachment":false,"key":"/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-7.0.0-beta.2.tgz"},"maintainers":[{"email":"bng412@gmail.com","name":"existentialism"},{"email":"me@thejameskyle.com","name":"thejameskyle"},{"email":"sebmck@gmail.com","name":"sebmck"},{"email":"daniel@tschinder.de","name":"danez"},{"email":"hi@henryzoo.com","name":"hzoo"},{"email":"loganfsmyth@gmail.com","name":"loganfsmyth"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-plugin-transform-class-properties-7.0.0-beta.2.tgz_1506438970828_0.7018775579053909"},"directories":{},"readme":"# babel-plugin-transform-class-properties\n\n> This plugin transforms es2015 static class properties as well as properties declared with the es2016 property initializer syntax.\n\n## Example\n\nBelow is a class with four class properties which will be transformed.\n\n```js\n  class Bork {\n    //Property initializer syntax\n    instanceProperty = \"bork\";\n    boundFunction = () => {\n      return this.instanceProperty;\n    }\n\n    //Static class properties\n    static staticProperty = \"babelIsCool\";\n    static staticFunction = function() {\n      return Bork.staticProperty;\n    }\n  }\n\n  let myBork = new Bork;\n\n  //Property initializers are not on the prototype.\n  console.log(myBork.prototype.boundFunction); // > undefined\n\n  //Bound functions are bound to the class instance.\n  console.log(myBork.boundFunction.call(undefined)); // > \"bork\"\n\n  //Static function exists on the class.\n  console.log(Bork.staticFunction()); // > \"babelIsCool\"\n```\n\n\n## Installation\n\n```sh\nnpm install --save-dev babel-plugin-transform-class-properties\n```\n\n## Usage\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n// without options\n{\n  \"plugins\": [\"transform-class-properties\"]\n}\n\n// with options\n{\n  \"plugins\": [\n    [\"transform-class-properties\", { \"spec\": true }]\n  ]\n}\n```\n\n### Via CLI\n\n```sh\nbabel --plugins transform-class-properties script.js\n```\n\n### Via Node API\n\n```javascript\nrequire(\"babel-core\").transform(\"code\", {\n  plugins: [\"transform-class-properties\"]\n});\n```\n\n## Options\n\n### `spec`\n\n`boolean`, defaults to `false`.\n\nClass properties are compiled to use `Object.defineProperty`. Static fields are now defined even if they are not initialized.\n\n## References\n\n* [Proposal: ES Class Fields & Static Properties](https://github.com/jeffmo/es-class-static-properties-and-fields)\n","publish_time":1506438971746,"_cnpm_publish_time":1506438971746,"dist-tags":{"latest":"6.24.1","next":"7.0.0-beta.3"}}