Comparing version 3.0.70 to 3.0.71
{ | ||
"name": "esm", | ||
"version": "3.0.70", | ||
"version": "3.0.71", | ||
"description": "Tomorrow's ECMAScript modules today!", | ||
@@ -10,2 +10,3 @@ "keywords": "commonjs, ecmascript, export, import, modules, node, require", | ||
"main": "esm.js", | ||
"runkitExample": "require = require(\"esm\")(module)\nrequire(\"lodash-es\")", | ||
"engines": { | ||
@@ -12,0 +13,0 @@ "node": ">=6" |
@@ -62,3 +62,3 @@ # esm | ||
* [`import`](https://ponyfoo.com/articles/es6-modules-in-depth#import) / [`export`](https://ponyfoo.com/articles/es6-modules-in-depth#export) | ||
* [`import`](https://ponyfoo.com/articles/es6-modules-in-depth#import)/[`export`](https://ponyfoo.com/articles/es6-modules-in-depth#export) | ||
* [`import.meta`](https://github.com/tc39/proposal-import-meta) | ||
@@ -83,3 +83,3 @@ * [Dynamic `import`](https://github.com/tc39/proposal-dynamic-import) | ||
<table><tr><td colspan=2><code>{</code><tr><td valign=top><code>"await":</code><td><p>A boolean for top-level <a href=https://node.green/#ES2017-features-async-functions-await><code>await</code></a> in modules <a href=https://github.com/mylesborins/proposal-top-level-await/#optional-constraint-top-level-await-can-only-be-used-in-modules-without-exports>without ESM exports</a>.<tr><td valign=top><code>"cjs":</code><td><p>A boolean or object for toggling CJS features in ESM.<details><summary>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>"mutableNamespace":</code><td><p>A boolean for mutable <a href=https://ponyfoo.com/articles/es6-modules-in-depth#import-all-the-things>namespace objects</a>.<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>"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>"mainFields":</code><td><p>An array of fields, e.g. <code>["main"]</code>, to check when importing a package.<tr><td valign=top><code>"mode":</code><td><p>A string mode:<ul><li><code>"auto"</code> detect files with <code>import</code>, <code>import.meta</code>, <code>export</code>,<br><a href=https://github.com/tc39/proposal-modules-pragma><code>"use module"</code></a>, or <code>.mjs</code> as ESM<li><code>"all"</code> script files are treated as ESM<li><code>"strict"</code> to treat <strong>only</strong> <code>.mjs</code> files as ESM</ul><tr><td colspan=2><code>}</code></table> | ||
<table><tr><td colspan=2><code>{</code><tr><td valign=top><code>"await":</code><td><p>A boolean for top-level <a href=https://node.green/#ES2017-features-async-functions-await><code>await</code></a> in modules <a href=https://github.com/mylesborins/proposal-top-level-await/#optional-constraint-top-level-await-can-only-be-used-in-modules-without-exports>without ESM exports</a>.<tr><td valign=top><code>"cjs":</code><td><p>A boolean or object for toggling CJS features in ESM.<details><summary>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>"mutableNamespace":</code><td><p>A boolean for mutable <a href=https://ponyfoo.com/articles/es6-modules-in-depth#import-all-the-things>namespace objects</a>.<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>"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>"force":</code><td><p>A boolean to apply these options to all module loads.<tr><td valign=top><code>"mainFields":</code><td><p>An array of fields, e.g. <code>["main"]</code>, checked when importing a package.<tr><td valign=top><code>"mode":</code><td><p>A string mode:<ul><li><code>"auto"</code> detect files with <code>import</code>, <code>import.meta</code>, <code>export</code>,<br><a href=https://github.com/tc39/proposal-modules-pragma><code>"use module"</code></a>, or <code>.mjs</code> as ESM<li><code>"all"</code> script files are treated as ESM<li><code>"strict"</code> to treat <strong>only</strong> <code>.mjs</code> files as ESM</ul><tr><td colspan=2><code>}</code></table> | ||
@@ -89,3 +89,3 @@ DevOpts | ||
<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 methods and stack traces.<tr><td valign=top><code>"sourceMap":</code><td><p>A boolean for including inline source maps.<tr><td colspan=2><code>}</code></table> | ||
<table><tr><td colspan=2><code>{</code><tr><td valign=top><code>"cache":</code><td><p>A boolean for toggling cache creation or cache directory path.<tr><td valign=top><code>"debug":</code><td><p>A boolean for unmasking methods and stack traces.<tr><td valign=top><code>"sourceMap":</code><td><p>A boolean for including inline source maps.<tr><td colspan=2><code>}</code></table> | ||
@@ -97,7 +97,7 @@ Tips | ||
* Add a “module” field to the `package.json` containing the relative path to the main ES module. | ||
* Add a “module” field to `package.json` with the path to the main ES module. | ||
:bulb: This is done automagically with `npm init esm` or `yarn create esm`.<br> | ||
:bulb: This is automagically done with `npm init esm` or `yarn create esm`. | ||
* When bundling with `browserify` use the [`esmify`](https://github.com/mattdesl/esmify) plugin | ||
* Use [`esmify`](https://github.com/mattdesl/esmify) with [`browserify`](http://browserify.org/). | ||
@@ -116,22 +116,20 @@ ### :wrench: Extensions | ||
* Load `esm` before other runtime loaders or APM packages like<br> | ||
- [`@babel/register`](https://babeljs.io/docs/en/next/babel-register.html) | ||
- [`newrelic`](https://github.com/newrelic/node-newrelic) | ||
- [`sqreen`](https://docs.sqreen.io/sqreen-for-nodejs/getting-started-2/) | ||
* Load `esm` before APMs/loaders like | ||
[`@babel/register`](https://babeljs.io/docs/en/next/babel-register.html), | ||
[`newrelic`](https://github.com/newrelic/node-newrelic), and | ||
[`sqreen`](https://docs.sqreen.io/sqreen-for-nodejs/getting-started-2/). | ||
* Load `esm` with the “node-args” options of packages like<br> | ||
- [`node-tap`](https://www.node-tap.org/cli/):<br> | ||
`--node-arg=-r --node-arg=esm` | ||
- [`pm2`](https://pm2.io/doc/en/runtime/reference/pm2-cli/#pm2-flags):<br> | ||
`--node-args="-r esm"` | ||
* Load `esm` with the “node-args” options of<br> | ||
- [`node-tap`](https://www.node-tap.org/cli/): `--node-arg=-r --node-arg=esm` | ||
- [`pm2`](https://pm2.io/doc/en/runtime/reference/pm2-cli/#pm2-flags): `--node-args="-r esm"` | ||
* Load `esm` with the “require” option of packages like<br> | ||
- [`ava`](https://github.com/avajs/ava/blob/master/docs/recipes/es-modules.md) | ||
- [`mocha`](https://mochajs.org/#-r---require-module-name) | ||
- [`nodemon`](https://nodemon.io/) | ||
- [`nyc`](https://github.com/istanbuljs/nyc#require-additional-modules) | ||
- [`qunit`](https://github.com/qunitjs/qunit/releases/tag/2.6.0) | ||
- [`tape`](https://github.com/substack/tape#preloading-modules) | ||
- [`ts-node`](https://github.com/TypeStrong/ts-node#cli-options) | ||
- [`webpack`](https://webpack.js.org/api/cli/#config-options) | ||
* Load `esm` with “require” options of | ||
[`ava`](https://github.com/avajs/ava/blob/master/docs/recipes/es-modules.md), | ||
[`mocha`](https://mochajs.org/#-r---require-module-name), | ||
[`nodemon`](https://nodemon.io/), | ||
[`nyc`](https://github.com/istanbuljs/nyc#require-additional-modules), | ||
[`qunit`](https://github.com/qunitjs/qunit/releases/tag/2.6.0), | ||
[`tape`](https://github.com/substack/tape#preloading-modules), | ||
[`ts-node`](https://github.com/TypeStrong/ts-node#cli-options), and | ||
[`webpack`](https://webpack.js.org/api/cli/#config-options). | ||
@@ -138,0 +136,0 @@ :reminder_ribbon: When using a package’s “require” option remember that, |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
249398
135