{ "_args": [ [ { "raw": "babel-plugin-transform-es2015-arrow-functions@^6.5.0", "scope": null, "escapedName": "babel-plugin-transform-es2015-arrow-functions", "name": "babel-plugin-transform-es2015-arrow-functions", "rawSpec": "^6.5.0", "spec": ">=6.5.0 <7.0.0", "type": "range" }, "/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-preset-react-native" ] ], "_from": "babel-plugin-transform-es2015-arrow-functions@>=6.5.0 <7.0.0", "_id": "babel-plugin-transform-es2015-arrow-functions@6.22.0", "_inCache": true, "_location": "/babel-plugin-transform-es2015-arrow-functions", "_nodeVersion": "6.9.0", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", "tmp": "tmp/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz_1484872427408_0.779699427774176" }, "_npmUser": { "name": "hzoo", "email": "hi@henryzoo.com" }, "_npmVersion": "3.10.10", "_phantomChildren": {}, "_requested": { "raw": "babel-plugin-transform-es2015-arrow-functions@^6.5.0", "scope": null, "escapedName": "babel-plugin-transform-es2015-arrow-functions", "name": "babel-plugin-transform-es2015-arrow-functions", "rawSpec": "^6.5.0", "spec": ">=6.5.0 <7.0.0", "type": "range" }, "_requiredBy": [ "/babel-preset-fbjs", "/babel-preset-react-native" ], "_resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", "_shasum": "452692cb711d5f79dc7f85e440ce41b9f244d221", "_shrinkwrap": null, "_spec": "babel-plugin-transform-es2015-arrow-functions@^6.5.0", "_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-preset-react-native", "dependencies": { "babel-runtime": "^6.22.0" }, "description": "Compile ES2015 arrow functions to ES5", "devDependencies": { "babel-helper-plugin-test-runner": "^6.22.0" }, "directories": {}, "dist": { "shasum": "452692cb711d5f79dc7f85e440ce41b9f244d221", "tarball": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz" }, "keywords": [ "babel-plugin" ], "license": "MIT", "main": "lib/index.js", "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" } ], "name": "babel-plugin-transform-es2015-arrow-functions", "optionalDependencies": {}, "readme": "# babel-plugin-transform-es2015-arrow-functions\n\n> Compile ES2015 arrow functions to ES5\n\n## Example\n\n**In**\n\n```javascript\nvar a = () => {};\nvar a = (b) => b;\n\nconst double = [1,2,3].map((num) => num * 2);\nconsole.log(double); // [2,4,6]\n\nvar bob = {\n _name: \"Bob\",\n _friends: [\"Sally\", \"Tom\"],\n printFriends() {\n this._friends.forEach(f =>\n console.log(this._name + \" knows \" + f));\n }\n};\nconsole.log(bob.printFriends());\n```\n\n**Out**\n\n```javascript\nvar a = function a() {};\nvar a = function a(b) {\n return b;\n};\n\nvar double = [1, 2, 3].map(function (num) {\n return num * 2;\n});\nconsole.log(double); // [2,4,6]\n\nvar bob = {\n _name: \"Bob\",\n _friends: [\"Sally\", \"Tom\"],\n printFriends: function printFriends() {\n var _this = this;\n\n this._friends.forEach(function (f) {\n return console.log(_this._name + \" knows \" + f);\n });\n }\n};\nconsole.log(bob.printFriends());\n```\n\n[Try in REPL](http://babeljs.io/repl/#?evaluate=true&lineWrap=true&presets=es2015%2Ces2015-loose&experimental=false&loose=false&spec=false&code=var%20a%20%3D%20()%20%3D%3E%20%7B%7D%3B%0Avar%20a%20%3D%20(b)%20%3D%3E%20b%3B%0A%0Aconst%20double%20%3D%20%5B1%2C2%2C3%5D.map((num)%20%3D%3E%20num%20*%202)%3B%0Aconsole.log(double)%3B%20%2F%2F%20%5B2%2C4%2C6%5D%0A%0Avar%20bob%20%3D%20%7B%0A%20%20_name%3A%20%22Bob%22%2C%0A%20%20_friends%3A%20%5B%22Sally%22%2C%20%22Tom%22%5D%2C%0A%20%20printFriends()%20%7B%0A%20%20%20%20this._friends.forEach(f%20%3D%3E%0A%20%20%20%20%20%20console.log(this._name%20%2B%20%22%20knows%20%22%20%2B%20f))%3B%0A%20%20%7D%0A%7D%3B%0Aconsole.log(bob.printFriends())%3B&playground=true)\n\n## Installation\n\n```sh\nnpm install --save-dev babel-plugin-transform-es2015-arrow-functions\n```\n\n## Usage\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```js\n// without options\n{\n \"plugins\": [\"transform-es2015-arrow-functions\"]\n}\n\n// with options\n{\n \"plugins\": [\n [\"transform-es2015-arrow-functions\", { \"spec\": true }]\n ]\n}\n```\n\n### Via CLI\n\n```sh\nbabel --plugins transform-es2015-arrow-functions script.js\n```\n\n### Via Node API\n\n```javascript\nrequire(\"babel-core\").transform(\"code\", {\n plugins: [\"transform-es2015-arrow-functions\"]\n});\n```\n\n## Options\n\n* `spec` - This option wraps the generated function in `.bind(this)` and keeps uses of `this` inside the function as-is, instead of using a renamed `this`. It also adds a runtime check to ensure the functions are not instantiated.\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-arrow-functions" }, "scripts": {}, "version": "6.22.0" }