{"_id":"babel-plugin-transform-es2015-modules-simple-commonjs","_rev":"448945","name":"babel-plugin-transform-es2015-modules-simple-commonjs","description":"Simplified imports and exports","dist-tags":{"latest":"0.3.0"},"maintainers":[{"name":"finom","email":""},{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"time":{"modified":"2021-08-05T06:54:32.000Z","created":"2016-02-20T14:32:23.898Z","0.3.0":"2016-05-19T20:18:06.539Z","0.2.0":"2016-05-11T09:44:32.368Z","0.1.1":"2016-04-11T17:34:15.664Z","0.1.0":"2016-04-11T12:30:04.016Z","0.0.2":"2016-02-20T16:14:45.464Z","0.0.1":"2016-02-20T14:32:23.898Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs.git"},"versions":{"0.3.0":{"name":"babel-plugin-transform-es2015-modules-simple-commonjs","version":"0.3.0","description":"Simplified imports and exports","repository":{"type":"git","url":"git+https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs.git"},"license":"MIT","main":"dist/index.js","dependencies":{"babel-plugin-transform-strict-mode":"^6.8.0","babel-runtime":"^6.3.19","babel-template":"^6.3.13","better-log":"^1.3.1"},"devDependencies":{"babel-cli":"^6.3.17","babel-core":"^6.3.21","babel-plugin-transform-runtime":"^6.3.13","babel-preset-es2015":"^6.5.0","babel-preset-es2015-webpack":"^6.4.1","babel-register":"^6.3.13","chalk":"^1.1.0","clear":"0.0.1","diff":"^1.4.0","watch":"^0.16.0"},"scripts":{"release":"babel src --out-dir dist","test":"node test","watch":"node test --watch","prepublish":"npm test && npm run release"},"keywords":["babel-plugin","commonjs"],"gitHead":"3105e907c1bcae21f4ce3a7497e24d93154afb17","bugs":{"url":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs/issues"},"homepage":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs#readme","_id":"babel-plugin-transform-es2015-modules-simple-commonjs@0.3.0","_shasum":"c15ef506967c1ee8b7290cedecdba4af6581ee1e","_from":".","_npmVersion":"3.5.2","_nodeVersion":"5.1.1","_npmUser":{"name":"agatronic","email":"luke.a.page@gmail.com"},"maintainers":[{"name":"finom","email":""},{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"dist":{"shasum":"c15ef506967c1ee8b7290cedecdba4af6581ee1e","size":4545,"noattachment":false,"key":"/babel-plugin-transform-es2015-modules-simple-commonjs/-/babel-plugin-transform-es2015-modules-simple-commonjs-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-transform-es2015-modules-simple-commonjs/download/babel-plugin-transform-es2015-modules-simple-commonjs-0.3.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-es2015-modules-simple-commonjs-0.3.0.tgz_1463689084147_0.9389784841332585"},"directories":{},"publish_time":1463689086539,"_cnpm_publish_time":1463689086539,"_hasShrinkwrap":false},"0.2.0":{"name":"babel-plugin-transform-es2015-modules-simple-commonjs","version":"0.2.0","description":"Simplified imports and exports","repository":{"type":"git","url":"git+https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs.git"},"license":"MIT","main":"dist/index.js","dependencies":{"babel-plugin-transform-strict-mode":"^6.8.0","babel-runtime":"^6.3.19","babel-template":"^6.3.13","better-log":"^1.3.1"},"devDependencies":{"babel-cli":"^6.3.17","babel-core":"^6.3.21","babel-plugin-transform-runtime":"^6.3.13","babel-preset-es2015":"^6.5.0","babel-preset-es2015-webpack":"^6.4.1","babel-register":"^6.3.13","chalk":"^1.1.0","clear":"0.0.1","diff":"^1.4.0","watch":"^0.16.0"},"scripts":{"release":"babel src --out-dir dist","test":"node test","watch":"node test --watch","prepublish":"npm test && npm run release"},"keywords":["babel-plugin","commonjs"],"gitHead":"bceb692ecfe0bca395c6cd268b865ece91907842","bugs":{"url":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs/issues"},"homepage":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs#readme","_id":"babel-plugin-transform-es2015-modules-simple-commonjs@0.2.0","_shasum":"705bdc6dabd58ac3eed2676d8425488b43b0b4e2","_from":".","_npmVersion":"3.8.6","_nodeVersion":"6.0.0","_npmUser":{"name":"finom","email":"a@odessite.com.ua"},"dist":{"shasum":"705bdc6dabd58ac3eed2676d8425488b43b0b4e2","size":4207,"noattachment":false,"key":"/babel-plugin-transform-es2015-modules-simple-commonjs/-/babel-plugin-transform-es2015-modules-simple-commonjs-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-transform-es2015-modules-simple-commonjs/download/babel-plugin-transform-es2015-modules-simple-commonjs-0.2.0.tgz"},"maintainers":[{"name":"finom","email":""},{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-es2015-modules-simple-commonjs-0.2.0.tgz_1462959870940_0.5586735715623945"},"directories":{},"publish_time":1462959872368,"_cnpm_publish_time":1462959872368,"_hasShrinkwrap":false},"0.1.1":{"name":"babel-plugin-transform-es2015-modules-simple-commonjs","version":"0.1.1","description":"Simplified imports and exports","repository":{"type":"git","url":"git+https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs.git"},"license":"MIT","main":"dist/index.js","dependencies":{"babel-runtime":"^6.3.19","better-log":"^1.3.1","babel-template":"^6.3.13"},"devDependencies":{"babel-cli":"^6.3.17","babel-core":"^6.3.21","babel-plugin-transform-runtime":"^6.3.13","babel-preset-es2015":"^6.5.0","babel-register":"^6.3.13","chalk":"^1.1.0","clear":"0.0.1","diff":"^1.4.0","watch":"^0.16.0"},"scripts":{"release":"babel src --out-dir dist","test":"node test","watch":"node test --watch","prepublish":"npm test && npm run release"},"keywords":["babel-plugin","commonjs"],"gitHead":"139a7d066ed0adad63d481aed177b95c3358b6fc","bugs":{"url":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs/issues"},"homepage":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs#readme","_id":"babel-plugin-transform-es2015-modules-simple-commonjs@0.1.1","_shasum":"516ddad9a0529ba44c0eb3ac9b502bff74816142","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"finom","email":"a@odessite.com.ua"},"dist":{"shasum":"516ddad9a0529ba44c0eb3ac9b502bff74816142","size":2928,"noattachment":false,"key":"/babel-plugin-transform-es2015-modules-simple-commonjs/-/babel-plugin-transform-es2015-modules-simple-commonjs-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-transform-es2015-modules-simple-commonjs/download/babel-plugin-transform-es2015-modules-simple-commonjs-0.1.1.tgz"},"maintainers":[{"name":"finom","email":""},{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-es2015-modules-simple-commonjs-0.1.1.tgz_1460396054399_0.43969534849748015"},"directories":{},"publish_time":1460396055664,"_cnpm_publish_time":1460396055664,"_hasShrinkwrap":false},"0.1.0":{"name":"babel-plugin-transform-es2015-modules-simple-commonjs","version":"0.1.0","description":"Simplified imports and exports","repository":{"type":"git","url":"git+https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs.git"},"license":"MIT","main":"dist/index.js","dependencies":{"babel-runtime":"^6.3.19","better-log":"^1.3.1","babel-template":"^6.3.13"},"devDependencies":{"babel-cli":"^6.3.17","babel-core":"^6.3.21","babel-plugin-transform-runtime":"^6.3.13","babel-preset-es2015":"^6.5.0","babel-register":"^6.3.13","chalk":"^1.1.0","clear":"0.0.1","diff":"^1.4.0","watch":"^0.16.0"},"scripts":{"release":"babel src --out-dir dist","test":"node test","watch":"node test --watch","prepublish":"npm test && npm run release"},"keywords":["babel-plugin","commonjs"],"gitHead":"6c8055fac14ec85e7545c154f7067f5efc35fd72","bugs":{"url":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs/issues"},"homepage":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs#readme","_id":"babel-plugin-transform-es2015-modules-simple-commonjs@0.1.0","_shasum":"e3d392b1f9d394a7fa348953d54b1e8fb661de4d","_from":".","_npmVersion":"3.8.6","_nodeVersion":"4.4.2","_npmUser":{"name":"finom","email":"a@odessite.com.ua"},"dist":{"shasum":"e3d392b1f9d394a7fa348953d54b1e8fb661de4d","size":2904,"noattachment":false,"key":"/babel-plugin-transform-es2015-modules-simple-commonjs/-/babel-plugin-transform-es2015-modules-simple-commonjs-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-transform-es2015-modules-simple-commonjs/download/babel-plugin-transform-es2015-modules-simple-commonjs-0.1.0.tgz"},"maintainers":[{"name":"finom","email":""},{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-es2015-modules-simple-commonjs-0.1.0.tgz_1460377802886_0.6313857312779874"},"directories":{},"publish_time":1460377804016,"_cnpm_publish_time":1460377804016,"_hasShrinkwrap":false},"0.0.2":{"name":"babel-plugin-transform-es2015-modules-simple-commonjs","version":"0.0.2","description":"Simplified imports and exports","repository":{"type":"git","url":"git+https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs.git"},"license":"MIT","main":"dist/index.js","dependencies":{"babel-runtime":"^6.3.19","better-log":"^1.3.1","babel-template":"^6.3.13"},"devDependencies":{"babel-cli":"^6.3.17","babel-core":"^6.3.21","babel-plugin-transform-runtime":"^6.3.13","babel-preset-es2015":"^6.5.0","babel-register":"^6.3.13","chalk":"^1.1.0","clear":"0.0.1","diff":"^1.4.0","watch":"^0.16.0"},"scripts":{"release":"babel src --out-dir dist","test":"node test","watch":"node test --watch","prepublish":"npm test && npm run release"},"keywords":["babel-plugin","commonjs"],"gitHead":"3461ab09a9aac10dd74cd15c38fcb4e768a20ec4","bugs":{"url":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs/issues"},"homepage":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs#readme","_id":"babel-plugin-transform-es2015-modules-simple-commonjs@0.0.2","_shasum":"b435fade2d9f6b002121b871cccad4ea6d8b9c67","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"finom","email":"a@odessite.com.ua"},"dist":{"shasum":"b435fade2d9f6b002121b871cccad4ea6d8b9c67","size":2757,"noattachment":false,"key":"/babel-plugin-transform-es2015-modules-simple-commonjs/-/babel-plugin-transform-es2015-modules-simple-commonjs-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-transform-es2015-modules-simple-commonjs/download/babel-plugin-transform-es2015-modules-simple-commonjs-0.0.2.tgz"},"maintainers":[{"name":"finom","email":""},{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-es2015-modules-simple-commonjs-0.0.2.tgz_1455984880798_0.75201519834809"},"directories":{},"publish_time":1455984885464,"_cnpm_publish_time":1455984885464,"_hasShrinkwrap":false},"0.0.1":{"name":"babel-plugin-transform-es2015-modules-simple-commonjs","version":"0.0.1","description":"Simplified imports and exports","repository":{"type":"git","url":"git+https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs.git"},"license":"MIT","main":"dist/index.js","dependencies":{"babel-runtime":"^6.3.19","better-log":"^1.3.1","babel-template":"^6.3.13"},"devDependencies":{"babel-cli":"^6.3.17","babel-core":"^6.3.21","babel-plugin-transform-runtime":"^6.3.13","babel-preset-es2015":"^6.5.0","babel-register":"^6.3.13","chalk":"^1.1.0","clear":"0.0.1","diff":"^1.4.0","watch":"^0.16.0"},"scripts":{"release":"babel src --out-dir dist","test":"node test","watch":"node test --watch"},"keywords":["babel-plugin","commonjs"],"gitHead":"2164cb9cb85e15af6e634a486c1e1462de34d327","bugs":{"url":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs/issues"},"homepage":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs#readme","_id":"babel-plugin-transform-es2015-modules-simple-commonjs@0.0.1","_shasum":"e4dd603b360d9b08daac7667c15a2bbb4106ef8e","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"finom","email":"a@odessite.com.ua"},"dist":{"shasum":"e4dd603b360d9b08daac7667c15a2bbb4106ef8e","size":2729,"noattachment":false,"key":"/babel-plugin-transform-es2015-modules-simple-commonjs/-/babel-plugin-transform-es2015-modules-simple-commonjs-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-plugin-transform-es2015-modules-simple-commonjs/download/babel-plugin-transform-es2015-modules-simple-commonjs-0.0.1.tgz"},"maintainers":[{"name":"finom","email":""},{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/babel-plugin-transform-es2015-modules-simple-commonjs-0.0.1.tgz_1455978740910_0.3537236168049276"},"directories":{},"publish_time":1455978743898,"_cnpm_publish_time":1455978743898,"_hasShrinkwrap":false}},"readme":"# babel-plugin-transform-es2015-modules-simple-commonjs [![npm version](https://badge.fury.io/js/babel-plugin-transform-es2015-modules-simple-commonjs.svg)](https://badge.fury.io/js/babel-plugin-transform-es2015-modules-simple-commonjs)\n\nSimple transformer for ECMAScript 2015 modules (CommonJS).\n\nConverts this code:\n```js\nimport x from '/path/to/x';\nimport y from '/path/to/y';\ndoSomething();\nexport default x + y;\n```\n\nInto this one:\n```js\nvar x = require('/path/to/x');\nvar y = require('/path/to/y');\ndoSomething();\nmodule.exports = x + y;\n```\n\nInstead of this one (generated with ``babel-plugin-transform-es2015-modules-commonjs``):\n```js\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _x = require('/path/to/x');\n\nvar _x2 = _interopRequireDefault(_x);\n\nvar _y = require('/path/to/y');\n\nvar _y2 = _interopRequireDefault(_y);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\ndoSomething();\nexports.default = _x2.default + _y2.default;\n```\n\nThis supports all standard es2015 import and export code with some caveats.\n\n## Caveats\n\n1. When exporting the final value is used, not the value when writing an export statement. It is not supported to mutate declarations that have been exported. You will not be warned, it will just not work.\n\n2. You cannot export default and export a named item in the same file as `module.exports` assignment will conflict with the `exports` assignment. This transform will error if you attempt to do this.\n\n3. If you mix default imports and importing `*`, it will work, but will not be valid in ES2015. E.g. with the following...\n\n```js\n// file a\nexport default 1;\n\n// file b\nimport * as a from './a';\n\n// file c\nexport const c = 3;\n\n// file d\nimport c from './c';\n```\n\nIn the official Babel module, `a` in `file b` will be undefined and `c` in `file d` will be undefined. Using this module, they will be `1` and `3` respectively.\n\n4. Updating the exports on-the-fly will not work. This is not supported within commonjs normally anyway, but is supported with the official plugin.\n\nYou may want to use a linter (such as eslint with eslint-plugin-import) in order to ensure that your code is standard whilst using this simplified transform.\n\n## Installation\n\n```sh\n$ npm install --save-dev babel-plugin-transform-es2015-modules-simple-commonjs\n```\n\n## Usage\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n{\n  \"plugins\": [\"transform-es2015-modules-simple-commonjs\"]\n}\n```\n\n### Via Node API\n\n```js\nrequire('babel').transform('code', {\n  plugins: ['transform-es2015-modules-simple-commonjs']\n});\n```\n\n### Usage with other ES2015 plugins\n\nThis replaces the functionality in `transform-es2015-modules-commonjs`, but you may be better off using this with the `babel-preset-es2015-webpack` preset, which takes the es2015 preset and removes the commonjs transform.\n","_attachments":{},"homepage":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs#readme","bugs":{"url":"https://github.com/finom/babel-plugin-transform-es2015-modules-simple-commonjs/issues"},"license":"MIT"}