{"_id":"@asapach/babel-plugin-transform-es2015-modules-commonjs","_rev":"4-3a03130fb61b011c6e88291f3300565f","name":"@asapach/babel-plugin-transform-es2015-modules-commonjs","dist-tags":{"latest":"6.26.3"},"versions":{"6.26.2":{"name":"@asapach/babel-plugin-transform-es2015-modules-commonjs","version":"6.26.2","keywords":["babel-plugin"],"license":"MIT","_id":"@asapach/babel-plugin-transform-es2015-modules-commonjs@6.26.2","maintainers":[{"name":"asapach","email":"dreamsonic@tut.by"}],"dist":{"shasum":"e2f59ffd28269acf7f17c6e04d95c6835f712a20","tarball":"https://registry.npmjs.org/@asapach/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz","fileCount":3,"integrity":"sha512-goZSkuFFZgMLwQnhuLVCFY8QsrtjKgE4mlk33Q2BpN6yQ/k5oDB2vD6f0elSf+DeXnJ59koFnX16ReMJfuwydA==","signatures":[{"sig":"MEUCIQDsGzhXH7kVl+YQxenujVOgvr6hwaQH3dXPbwlM3NxI+AIgOwq7zUwKrnf/9MjA5BMuVwhvryBGYTTTPYoB0yJWgcY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4QUACRA9TVsSAnZWagAAcOsQAJy6Imm1mIQ+b8YJv0ky\n5ECpob+oWjEogt6FuPG2qVLBeXGi2nhOk/0afBQ9M7jQsif1h9gSRMoak0bl\nc5FR036Yktm1YBYsQfKodyQFtO4B+a8omMy+6qq8qNJPUjvJBElaalKJ6HCq\nlaZUyRs9R1abBL6NCpM7COzeFTQr5bRVmIt1rv1XksF52aOfmPbcC0R3Uy6z\n8VDPBQ8iM93MWg1iAvLGFulbDkkmHszXSFy+UpwQxJGDA2Hcv6aL76Ktqsce\nEbbUXbbfc9MO34j+45GunJLBAZr29k8O65LiKZmRMkjT7ELvXA1173+aSsKH\nMsjtwddwheRXRWBCgoKJOjoaDzdj7QvO7NHzCI5ybUku3VgAzllZmyMeTPH+\ncC/x9h6oo4ZVo/Eq19b/HceuseMA8cGK1hRAhVGrm+09/A0YQCSqRoGg2nxW\nycoj/0pQ5jwqTjPScWLfgfBO8TrZY8ONebACu36YO2RvivE9ZCj4vXzwfGbC\naxIsEv2pKlgTdPTitNe5DDZzXV9jpYHzQ3unEiEDJ589VUG4OLp+nAm+tz1Z\n916tFTxhpJtJ2g4FBctNNK09PKd92ZsaYEfSnRlno71Cln55RcK0/INNkSZu\n1Pden6sL4wrmhcgE6Tzo13G3JaCr/9kva5Y/Z3zpBdYhN5oa//2B0vdHIqb2\nAY63\r\n=qJ8R\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","_npmUser":{"name":"asapach","email":"dreamsonic@tut.by"},"repository":{"url":"https://github.com/asapach/babel/tree/6.x/packages/babel-plugin-transform-es2015-modules-commonjs","type":"git"},"_npmVersion":"5.6.0","description":"This plugin transforms ES2015 modules to CommonJS","directories":{},"_nodeVersion":"8.11.1","dependencies":{"babel-types":"^6.26.0","babel-runtime":"^6.26.0","babel-template":"^6.26.0","babel-plugin-transform-strict-mode":"^6.24.1"},"_hasShrinkwrap":false,"devDependencies":{"babel-helper-plugin-test-runner":"^6.24.1","babel-plugin-syntax-object-rest-spread":"^6.13.0"},"_npmOperationalInternal":{"tmp":"tmp/babel-plugin-transform-es2015-modules-commonjs_6.26.2_1524696319161_0.9490991897990853","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"6.26.3":{"name":"@asapach/babel-plugin-transform-es2015-modules-commonjs","version":"6.26.3","keywords":["babel-plugin"],"license":"MIT","_id":"@asapach/babel-plugin-transform-es2015-modules-commonjs@6.26.3","maintainers":[{"name":"asapach","email":"dreamsonic@tut.by"}],"dist":{"shasum":"e2cfefa1e2c5c23889693f8fdb68afdb2a5b4d2b","tarball":"https://registry.npmjs.org/@asapach/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.3.tgz","fileCount":3,"integrity":"sha512-su5HzR9n9YvExjCMPGFfQHulp5fCRCBKop/skSyTGw/k4ZT7gNI/Xzpu95UZOvJt6uSytvSzprgDrzlfJtJUGg==","signatures":[{"sig":"MEYCIQDncFFQwT8/VnSveyE/ZgE7mzlSngvaouhS3Ftt9E7OEQIhALFTnMG7FEzY/si7se3SRIsfq+cRmYE92O1xqn49+xCX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":29697,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4wOJCRA9TVsSAnZWagAALrkP/3vg6sxKBkCPk/lSgqqd\n891+nY/WdUrIrgc1UESmtyzaWul4MMHpAKQ1ycbY/+svpMPT+Ezbg15GG+eR\n3/2RlGd4Ip+zSBcO4FDvW+aA2qD0rt+ckand2/pK01+qVKSzTVaaqxjRtPsQ\nJ8Odo4H/DGMN3rv7MqwD5DQvpas6cKkVB71z4W33YoornZ46NFUS8Xy5RZi/\noOCoNqSvd3fukf9tU9AyzNCS0XNTLE8pm591/H2F4J7dFvVP+Y0VBC36DBxx\nZ4MsIXmjUw/JRl2prrGCAyAlJLkxYm8woHVYkBY2zTKkHfB85+EeUuPMrCJ3\nraIUeUw2JMzzo/sx2bXoXLYQwtoD0reIlnJw0SSF8gnuNOZJa6Ib5KmcFVBZ\nfQdXWkwtfZ3XO1fCYiEuRiB4cCZvoy0EngVnPUjz/yI0TnScSl/QsoDLnmmV\nyowFMxV7GiC2fDYsLQ29wRAPTGJnxDClNzcVu/5Pnkrn/MbDc+QUUVZj8Lj8\nQeWMqLPhgF0bdqarq1HXZXZ2g0dVUojRqoOqqObgwffaC929jIGTmBZLofey\nbR8dK2niAANvfVBrySiKdyqrpXY/XTJjtcgKt1lokh4ulZzvamc6JYET/emJ\nFhAxseY1JJZsQW0hKxvx+T88sKoOyFppZoQK05YuJfasSnwEYwpbTqZNB7r+\nnwF6\r\n=arMj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","_npmUser":{"name":"asapach","email":"dreamsonic@tut.by"},"repository":{"url":"https://github.com/asapach/babel/tree/6.x/packages/babel-plugin-transform-es2015-modules-commonjs","type":"git"},"_npmVersion":"5.6.0","description":"This plugin transforms ES2015 modules to CommonJS","directories":{},"_nodeVersion":"8.11.1","dependencies":{"babel-types":"^6.26.0","babel-runtime":"^6.26.0","babel-template":"^6.26.0","babel-plugin-transform-strict-mode":"^6.24.1"},"_hasShrinkwrap":false,"devDependencies":{"babel-helper-plugin-test-runner":"^6.24.1","babel-plugin-syntax-object-rest-spread":"^6.13.0"},"_npmOperationalInternal":{"tmp":"tmp/babel-plugin-transform-es2015-modules-commonjs_6.26.3_1524827017321_0.53673744732356","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2018-04-25T22:45:19.098Z","modified":"2026-07-09T20:49:48.719Z","6.26.2":"2018-04-25T22:45:19.239Z","6.26.3":"2018-04-27T11:03:37.372Z"},"license":"MIT","keywords":["babel-plugin"],"repository":{"url":"https://github.com/asapach/babel/tree/6.x/packages/babel-plugin-transform-es2015-modules-commonjs","type":"git"},"description":"This plugin transforms ES2015 modules to CommonJS","maintainers":[{"name":"asapach","email":"dreamsonic@tut.by"}],"readme":"# @asapach/babel-plugin-transform-es2015-modules-commonjs\n\nThis is a fork that backports [#6238](https://github.com/babel/babel/pull/6238) to Babel 6.\n\n> This plugin transforms ES2015 modules to [CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1).\n>\n> #### Babel 6 Changes\n> \n> Babel 6 changed some behavior by not doing `module.exports = exports['default']` anymore in the modules transforms.\n> \n> There are some caveats, but you can use [babel-plugin-add-module-exports](https://www.npmjs.com/package/babel-plugin-add-module-exports), so that updating to Babel 6 isn't a breaking change since users that don't use ES modules don't have to do `require(\"your-module\").default`.\n> \n> However, it may not match how Node eventually implements ES modules natively given the [the current proposal](https://github.com/nodejs/node-eps/blob/master/002-es-modules.md#46-es-consuming-commonjs).\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"}