{"name":"@std/esm","version":"0.26.0","description":"Enable ES modules in Node today!","keywords":["commonjs","ecmascript","export","import","modules","node","require"],"repository":{"type":"git","url":"git+https://github.com/standard-things/esm.git"},"license":"MIT","author":{"name":"John-David Dalton","email":"john.david.dalton@gmail.com"},"main":"index.js","engines":{"node":">=6"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"files":["index.js","esm.js"],"gitHead":"3fd56c07c6fda1960a898a9fb3767899aa8f8766","bugs":{"url":"https://github.com/standard-things/esm/issues"},"homepage":"https://github.com/standard-things/esm#readme","_id":"@std/esm@0.26.0","_npmVersion":"5.8.0","_nodeVersion":"9.9.0","_npmUser":{"name":"jdalton","email":"john.david.dalton@gmail.com"},"dist":{"integrity":"sha512-g3RDuosSa5fZOzENtrZdx7Gevb3zabfn8qglug2aCJIVz/4woFpKoqm1yD3mG2RD0zJEZRnkkuPHsmNglKGl7g==","shasum":"c3ec3abdee95738e15ea7c695b7fee14ae529b81","tarball":"http://registry-npm.ywwl.com/@std/esm/download/@std/esm-0.26.0.tgz","fileCount":5,"unpackedSize":226993,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2cTPCRA9TVsSAnZWagAAzlsP/0ujgwF25BeLoQAZHIyT\nmD5z9NkKWIswlpAQdbKC6e978MOI7wrFtha5VYwZAo6mCLgCCk5oLWHYU0Pa\nSj4eRjTeITYWbkHfo72M4ueikKIWR6ipIYIJHClVe5kHsNj0SQ+LAJkX7Kto\nlzuW3JtyowEKh5OWPzW+jVwHQDi2t/Iy2M6dYxWI0tCuBLRdMlZsLb48OMKw\n81mz+kHOX8UTMz3KohOuBcuJtxrhyMIs49DxNzui8YS0pn4rTQQbz52tja/2\nJyfmyn61mgvgtaeOw4W6s4ch9DMZm2AUvgyusveM6NCf90PlTx73K9/PWcGg\nPIsWlVZJSLyh0KKGTVhSZGVu7f0PK5qY/9GmlOKrpLzGzzB41uYlOc6tP8by\n1Q3GCxIy8NPmkY3Iosp/26XENyyQtaAumBi0Xb+Z9vqpzqTylXo2ZGzYzNTg\n6jB/P/PvLqc3RTseFcIuI/C/3elXPdoo6UNXXeto8OO/3zHPD9zwdaTtDEyw\nmyztTwblndZ4gVlv7ZEBZNTj8thmga2Af4jdpVfznyQPKAz8AzdxdrMhoakO\nYfie7G2FpX7uxEWYgru6aP9tx/0AkEvZofsD6FLAO52I1sxy2Cevk1vUEh4e\nhiAWjpWbWI9F1d4JjXzMzwdKFTgpRNW9qAsHd5qvleIRTFIDaE+i8jYrCmI6\n9dZE\r\n=w7YC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQ1/EelLy020Dsvh9JrGKWS5NRzFUYQiO462uvUYjAiAiB0qU/2WX5qLIbmJDr+f0Oc8TvDunIDnGwSXL1ReI2riA=="}],"size":70048,"noattachment":false,"key":"/@std/esm/-/@std/esm-0.26.0.tgz"},"maintainers":[{"name":"jdalton","email":"john.david.dalton@gmail.com"},{"name":"mathias","email":"mathias@qiwi.be"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esm_0.26.0_1522172466636_0.41677485276319204"},"_hasShrinkwrap":false,"deprecated":"This package is discontinued. Use https://npmjs.com/esm","readme":"# @std/esm\n\nThis fast, small, zero-dependency package is all you need to enable\nES modules in Node 6+ today!\n\nSee the release [post](https://medium.com/web-on-the-edge/es-modules-in-node-today-32cff914e4b)\n:book: and [video](https://www.youtube.com/watch?v=60S1PFndbn0) :movie_camera:\nfor all the details.\n\nDiscontinued\n---\n\nThis package has been discontinued in favor of [`esm`](https://www.npmjs.com/package/esm).\n\nGetting started\n---\n\nRun `npm i --save @std/esm` in your app or package directory.\n\nThere are three ways to enable ESM with `@std/esm`.\n\n1. Enable ESM with a CJS bridge:\n\n    **index.js**\n    ```js\n    // Provide options as a parameter, environment variable, or rc file.\n    require = require(\"@std/esm\")(module/*, options*/)\n    module.exports = require(\"./main.mjs\").default\n    ```\n\n2. Enable ESM in the Node CLI with the [`-r` option](https://nodejs.org/api/cli.html#cli_r_require_module):\n\n    ```shell\n    node -r @std/esm main.mjs\n    ```\n\n3. Enable ESM in the Node REPL:\n\n    ```shell\n    node -r @std/esm\n    ```\n\n    or upon entering:\n\n    ```shell\n    $ node\n    > require(\"@std/esm\")\n    @std/esm enabled\n    ```\n\n*Note: All `\"cjs\"` options are [unlocked](#unlockables) in the Node REPL.*\n\nStandard Features\n---\n\nThe `@std/esm` loader is as spec-compliant\nas possible and follows Node’s [ESM rules](https://github.com/nodejs/node-eps/blob/master/002-es-modules.md).\n\n:point_right: This means, by default, ESM requires the use of the `.mjs` file\nextension.<br>\n:unlock: You can [unlock](#unlockables) ESM with the `.js` file extension using\nthe `\"js\"` ESM mode.\n\nOut of the box `@std/esm` just works, no configuration necessary, and supports:\n\n* [`import`](https://ponyfoo.com/articles/es6-modules-in-depth#import) / [`export`](https://ponyfoo.com/articles/es6-modules-in-depth#export)\n* [`import.meta`](https://github.com/tc39/proposal-import-meta)\n* [Dynamic `import`](https://github.com/tc39/proposal-dynamic-import)\n* [Improved errors](https://github.com/standard-things/esm/wiki/improved-errors)\n* [Live bindings](https://ponyfoo.com/articles/es6-modules-in-depth#bindings-not-values)\n* [Loading `.mjs` files as ESM](https://github.com/nodejs/node-eps/blob/master/002-es-modules.md#32-determining-if-source-is-an-es-module)\n* [The file URI scheme](https://en.wikipedia.org/wiki/File_URI_scheme)\n* Node [`--eval`](https://nodejs.org/api/cli.html#cli_e_eval_script) and [`--print`](https://nodejs.org/api/cli.html#cli_p_print_script) flags\n* Node 6+ support\n\nUnlockables\n---\n\nUnlock features with options specified as one of the following:\n\n* The `\"@std/esm\"` field in your package.json\n* [JSON6](https://github.com/d3x0r/json6) in an .esmrc or .esmrc.json file\n* JSON6 or file path in the `ESM_OPTIONS` environment variable\n* CJS/ESM in an .esmrc.js or .esmrc.mjs file\n\nCommonly used options may be specified in shorthand form:\n\n* `\"@std/esm\":\"js\"` is shorthand for `\"@std/esm\":{\"mode\":\"js\"}`\n* `\"@std/esm\":\"cjs\"` is shorthand for `\"@std/esm\":{\"cjs\":true,\"mode\":\"js\"}`\n\n<table><tr><td colspan=2><code>{</code><tr><td valign=top><code>\"mode\":</code><td><p>A string mode:<ul><li><code>\"all\"</code> files as ESM<li><code>\"js\"</code> and other files with <code>import</code>, <code>import.meta</code>, <code>export</code>, or <a href=https://github.com/tc39/proposal-modules-pragma><code>\"use module\"</code></a> as ESM</ul><tr><td valign=top><code>\"cjs\":</code><td><p>A boolean or object to unlock CJS features in ESM.<details><summary>Unlockable Features</summary><table><tr><td colspan=2><code>{</code><tr><td valign=top><code>\"cache\":</code><td><p>A boolean for storing ES modules in <code>require.cache</code>.<tr><td valign=top><code>\"extensions\":</code><td><p>A boolean for respecting <code>require.extensions</code> in ESM.<tr><td valign=top><code>\"interop\":</code><td><p>A boolean for <code>__esModule</code> interoperability.<tr><td valign=top><code>\"namedExports\":</code><td><p>A boolean for <a href=https://ponyfoo.com/articles/es6-modules-in-depth#importing-named-exports>importing named exports</a> of CJS modules.<tr><td valign=top><code>\"paths\":</code><td><p>A boolean for following CJS <a href=https://github.com/nodejs/node-eps/blob/master/002-es-modules.md#432-removal-of-non-local-dependencies>path rules</a> in ESM.<tr><td valign=top><code>\"topLevelReturn\":</code><td><p>A boolean for <a href=http://stackoverflow.com/questions/28955047/why-does-a-module-level-return-statement-work-in-node-js/#28955050>top-level <code>return</code></a>.<tr><td valign=top><code>\"vars\":</code><td><p>A boolean for <code>__dirname</code>, <code>__filename</code>, and <code>require</code> in ESM.<tr><td colspan=2><code>}</code></table></details><tr><td valign=top><code>\"await\":</code><td><p>A boolean for <a href=https://github.com/MylesBorins/proposal-top-level-await#variant-c-top-level-await-can-only-be-used-in-modules-without-exports>top-level <code>await</code></a> in modules without ESM exports. <i>(requires Node 7.6+)</i><tr><td colspan=2><code>}</code></table>\n\nDevOpts\n---\n\n<table><tr><td colspan=2><code>{</code><tr><td valign=top><code>\"cache\":</code><td><p>A boolean for toggling cache creation or string path of the cache directory.<tr><td valign=top><code>\"debug\":</code><td><p>A boolean for unmasking stack traces.<tr><td valign=top><code>\"sourceMap\":</code><td><p>A boolean for including inline source maps.<tr><td valign=top><code>\"warnings\":</code><td><p>A boolean for logging development parse and runtime warnings.<tr><td colspan=2><code>}</code></table>\n\nTips\n---\n* Load `@std/esm` before\n  [`@babel/register`](https://github.com/babel/babel/tree/master/packages/babel-register) v7+\n* Load `@std/esm` with the *“require”* option of\n  [`ava`](https://github.com/avajs/ava#options),\n  [`mocha`](https://mochajs.org/#-r---require-module-name),\n  [`nyc`](https://github.com/istanbuljs/nyc#require-additional-modules), and\n  [`tape`](https://github.com/substack/tape#preloading-modules)\n* Load `@std/esm` with the `--node-arg=-r --node-arg=@std/esm` option of\n  [`node-tap`](http://www.node-tap.org/cli/)\n* Load `@std/esm` with the `--node-args=\"-r @std/esm\"` option of\n  [`pm2`](http://pm2.keymetrics.io/docs/usage/quick-start/#options)\n* Load `@std/esm` with [`wallaby.js`](https://wallabyjs.com/docs/integration/node.html#es-modules)\n* Use `@std/esm` to load [`jasmine`](https://jasmine.github.io/setup/nodejs.html#a-simple-example-using-the-library)\n* Use `\"@std/esm\":\"cjs\"` for the `--watch` and `--watch-extensions` options of\n  [`mocha`](https://mochajs.org/#-w---watch)\n* Use `\"@std/esm\":\"cjs\"` for [`ava`](https://github.com/avajs/ava) and [`webpack`](https://github.com/webpack/webpack)\n* When in doubt, use `\"@std/esm\":\"cjs\"`\n","publish_time":1522172466726,"_cnpm_publish_time":1522172466726,"dist-tags":{"latest":"0.26.0"}}