{ "_args": [ [ { "raw": "babel-plugin-transform-es2015-modules-commonjs@^6.5.0", "scope": null, "escapedName": "babel-plugin-transform-es2015-modules-commonjs", "name": "babel-plugin-transform-es2015-modules-commonjs", "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-modules-commonjs@>=6.5.0 <7.0.0", "_id": "babel-plugin-transform-es2015-modules-commonjs@6.26.0", "_inCache": true, "_location": "/babel-plugin-transform-es2015-modules-commonjs", "_nodeVersion": "6.9.0", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz_1502898859361_0.6545935710892081" }, "_npmUser": { "name": "hzoo", "email": "hi@henryzoo.com" }, "_npmVersion": "4.6.1", "_phantomChildren": {}, "_requested": { "raw": "babel-plugin-transform-es2015-modules-commonjs@^6.5.0", "scope": null, "escapedName": "babel-plugin-transform-es2015-modules-commonjs", "name": "babel-plugin-transform-es2015-modules-commonjs", "rawSpec": "^6.5.0", "spec": ">=6.5.0 <7.0.0", "type": "range" }, "_requiredBy": [ "/babel-preset-es2015-node", "/babel-preset-fbjs", "/babel-preset-react-native" ], "_resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", "_shasum": "0d8394029b7dc6abe1a97ef181e00758dd2e5d8a", "_shrinkwrap": null, "_spec": "babel-plugin-transform-es2015-modules-commonjs@^6.5.0", "_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/babel-preset-react-native", "dependencies": { "babel-plugin-transform-strict-mode": "^6.24.1", "babel-runtime": "^6.26.0", "babel-template": "^6.26.0", "babel-types": "^6.26.0" }, "description": "This plugin transforms ES2015 modules to CommonJS", "devDependencies": { "babel-helper-plugin-test-runner": "^6.24.1", "babel-plugin-syntax-object-rest-spread": "^6.13.0" }, "directories": {}, "dist": { "shasum": "0d8394029b7dc6abe1a97ef181e00758dd2e5d8a", "tarball": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz" }, "keywords": [ "babel-plugin" ], "license": "MIT", "main": "lib/index.js", "maintainers": [ { "name": "thejameskyle", "email": "me@thejameskyle.com" }, { "name": "sebmck", "email": "sebmck@gmail.com" }, { "name": "danez", "email": "daniel@tschinder.de" }, { "name": "hzoo", "email": "hi@henryzoo.com" }, { "name": "loganfsmyth", "email": "loganfsmyth@gmail.com" } ], "name": "babel-plugin-transform-es2015-modules-commonjs", "optionalDependencies": {}, "readme": "# babel-plugin-transform-es2015-modules-commonjs\n\n> This plugin transforms ES2015 modules to [CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1).\n\n## Example\n\n**In**\n\n```javascript\nexport default 42;\n```\n\n**Out**\n\n```javascript\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = 42;\n```\n\n## Installation\n\n```sh\nnpm install --save-dev babel-plugin-transform-es2015-modules-commonjs\n```\n\n## Usage\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```js\n// without options\n{\n \"plugins\": [\"transform-es2015-modules-commonjs\"]\n}\n\n// with options\n{\n \"plugins\": [\n [\"transform-es2015-modules-commonjs\", {\n \"allowTopLevelThis\": true\n }]\n ]\n}\n```\n\n### Via CLI\n\n```sh\nbabel --plugins transform-es2015-modules-commonjs script.js\n```\n\n### Via Node API\n\n```javascript\nrequire(\"babel-core\").transform(\"code\", {\n plugins: [\"transform-es2015-modules-commonjs\"]\n});\n```\n\n## Options\n\n### `loose`\n\n`boolean`, defaults to `false`.\n\nAs per the spec, `import` and `export` are only allowed to be used at the top\nlevel. When in loose mode these are allowed to be used anywhere.\n\nAnd by default, when using exports with babel a non-enumerable `__esModule` property\nis exported.\n\n```javascript\nvar foo = exports.foo = 5;\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n```\n\nIn environments that don't support this you can enable loose mode on `babel-plugin-transform-es2015-modules-commonjs`\nand instead of using `Object.defineProperty` an assignment will be used instead.\n\n```javascript\nvar foo = exports.foo = 5;\nexports.__esModule = true;\n```\n\n### `strict`\n\n`boolean`, defaults to `false`\n\nBy default, when using exports with babel a non-enumerable `__esModule` property\nis exported. In some cases this property is used to determine if the import _is_ the\ndefault export or if it _contains_ the default export.\n\n```javascript\nvar foo = exports.foo = 5;\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n```\n\nIn order to prevent the `__esModule` property from being exported, you can set\nthe `strict` option to `true`.\n\n### `noInterop`\n\n`boolean`, defaults to `false`\n\nBy default, when using exports with babel a non-enumerable `__esModule` property\nis exported. This property is then used to determine if the import _is_ the default\nexport or if it _contains_ the default export.\n\n```javascript\n\"use strict\";\n\nvar _foo = require(\"foo\");\n\nvar _foo2 = _interopRequireDefault(_foo);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\n```\n\nIn cases where the auto-unwrapping of `default` is not needed, you can set the\n`noInterop` option to `true` to avoid the usage of the `interopRequireDefault`\nhelper (shown in inline form above).\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-es2015-modules-commonjs" }, "scripts": {}, "version": "6.26.0" }