{"name":"babel-plugin-transform-class-properties","version":"6.19.0","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":"^6.18.0","babel-plugin-syntax-class-properties":"^6.8.0","babel-runtime":"^6.9.1","babel-template":"^6.15.0"},"devDependencies":{"babel-helper-plugin-test-runner":"^6.18.0"},"_id":"babel-plugin-transform-class-properties@6.19.0","scripts":{},"_shasum":"1274b349abaadc835164e2004f4a2444a2788d5f","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.0","_npmUser":{"name":"hzoo","email":"hi@henryzoo.com"},"dist":{"shasum":"1274b349abaadc835164e2004f4a2444a2788d5f","tarball":"http://registry-npm.ywwl.com/babel-plugin-transform-class-properties/download/babel-plugin-transform-class-properties-6.19.0.tgz","integrity":"sha512-XB0HO/pVZJKtxyfYZ3vfg0xyMBko3FwmdEqie0WMifIHqypENPFCPdfSEIuk3vRRJV2+qepS0R0p1gFjMaDaxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkdb6DNWR+aviMUYiZWZgvTpNS5piYZ1G28k7LQMaEnAIgb6t39n1/N2Y6c4jzcCCH6dZeXPIWnFXoMJ38c8piPiE="}],"size":2946,"noattachment":false,"key":"/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.19.0.tgz"},"maintainers":[{"name":"amasad","email":"amjad.masad@gmail.com"},{"name":"hzoo","email":"hi@henryzoo.com"},{"name":"jmm","email":"npm-public@jessemccarthy.net"},{"name":"loganfsmyth","email":"loganfsmyth@gmail.com"},{"name":"sebmck","email":"sebmck@gmail.com"},{"name":"thejameskyle","email":"me@thejameskyle.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-class-properties-6.19.0.tgz_1479312925861_0.2576622653286904"},"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":1479312928049,"_cnpm_publish_time":1479312928049,"dist-tags":{"latest":"6.24.1","next":"7.0.0-beta.3"}}