-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
94 changed files
with
715 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
* {integer} | ||
* {string|null} | ||
|
||
The `subprocess.signalCode` property indicates the signal number received by | ||
The `subprocess.signalCode` property indicates the signal received by | ||
the child process if any, else `null`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
A constructor for a class was called without `new`. | ||
|
||
<a id="ERR_CONSTRUCT_CALL_INVALID"></a> | ||
<a id="ERR_CONTEXT_NOT_INITIALIZED"></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
An attempt was made to send multiple response headers. | ||
|
||
<a id="ERR_HTTP2_HEADER_SINGLE_VALUE"></a> | ||
<a id="ERR_HTTP2_INFO_STATUS_NOT_ALLOWED"></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
The client has not sent the entire request within the allowed time. | ||
|
||
<a id="ERR_HTTP_HEADERS_SENT"></a> | ||
<a id="ERR_INDEX_OUT_OF_RANGE"></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
An invalid `package.json` file failed parsing. | ||
An invalid [`package.json`][] file was found which failed parsing. | ||
|
||
<a id="ERR_INVALID_PACKAGE_TARGET"></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
The `package.json` [exports][] field contains an invalid target mapping value | ||
for the attempted module resolution. | ||
The `package.json` [`"exports"`][] field contains an invalid target mapping | ||
value for the attempted module resolution. | ||
|
||
<a id="ERR_INVALID_PERFORMANCE_MARK"></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
The `package.json` ["imports" field][] does not define the given internal | ||
The `package.json` [`"imports"`][] field does not define the given internal | ||
package specifier mapping. | ||
|
||
<a id="ERR_PACKAGE_PATH_NOT_EXPORTED"></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
Valid TLS protocol versions are `'TLSv1'`, `'TLSv1.1'`, or `'TLSv1.2'`. | ||
|
||
<a id="ERR_TLS_PROTOCOL_VERSION_CONFLICT"></a> | ||
<a id="ERR_TLS_INVALID_STATE"></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
<!-- YAML | ||
added: v13.10.0 | ||
added: | ||
- v13.10.0 | ||
- v12.17.0 | ||
--> | ||
|
||
The TLS socket must be connected and securily established. Ensure the 'secure' | ||
event is emitted before continuing. | ||
|
||
<a id="ERR_TLS_INVALID_PROTOCOL_METHOD"></a> | ||
<a id="ERR_TLS_PROTOCOL_VERSION_CONFLICT"></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
Failed to set PSK identity hint. Hint may be too long. | ||
|
||
<a id="ERR_TRACE_EVENTS_CATEGORY_REQUIRED"></a> | ||
<a id="ERR_TLS_RENEGOTIATION_DISABLED"></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,5 +78,6 @@ closed. | |
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
|
||
CommonJS modules consist of a `module.exports` object which can be of any type. | ||
|
||
When importing a CommonJS module, it can be reliably imported using the ES | ||
module default import or its corresponding sugar syntax: | ||
|
||
<!-- eslint-disable no-duplicate-imports --> | ||
```js | ||
import { default as cjs } from 'cjs'; | ||
// The following import statement is "syntax sugar" (equivalent but sweeter) | ||
// for `{ default as cjsSugar }` in the above import statement: | ||
import cjsSugar from 'cjs'; | ||
console.log(cjs); | ||
console.log(cjs === cjsSugar); | ||
// Prints: | ||
// <module.exports> | ||
// true | ||
``` | ||
|
||
The ECMAScript Module Namespace representation of a CommonJS module will always | ||
be a namespace with a `default` export key pointing to the CommonJS | ||
`module.exports` value. | ||
|
||
This Module Namespace Exotic Object can be directly observed either when using | ||
`import * as m from 'cjs'` or a dynamic import: | ||
|
||
<!-- eslint-skip --> | ||
```js | ||
import * as m from 'cjs'; | ||
console.log(m); | ||
console.log(m === await import('cjs')); | ||
// Prints: | ||
// [Module] { default: <module.exports> } | ||
// true | ||
``` | ||
|
||
For better compatibility with existing usage in the JS ecosystem, Node.js will | ||
in addition attempt to determine the CommonJS named exports of every imported | ||
CommonJS module to provide them as separate ES module exports using a static | ||
analysis process. | ||
|
||
For example, a CommonJS module written: | ||
|
||
```js | ||
// cjs.cjs | ||
exports.name = 'exported'; | ||
``` | ||
|
||
will support named imports in ES modules: | ||
|
||
<!-- eslint-disable no-duplicate-imports --> | ||
```js | ||
import { name } from './cjs.cjs'; | ||
console.log(name); | ||
// Prints: 'exported' | ||
import cjs from './cjs.cjs'; | ||
console.log(cjs); | ||
// Prints: { name: 'exported' } | ||
import * as m from './cjs.cjs'; | ||
console.log(m); | ||
// Prints: [Module] { default: { name: 'exported' }, name: 'exported' } | ||
``` | ||
|
||
As can be seen from the last example of the Module Namespace Exotic Object being | ||
logged, the `name` export is copied off of the `module.exports` object and set | ||
directly on the ES module namespace when the module is imported. | ||
|
||
Live binding updates or new exports added to `module.exports` are not detected | ||
for these named exports. | ||
|
||
The detection of named exports is based on common syntax patterns but will not | ||
always correctly detect named exports, in these cases using the default | ||
import form described above can be a better option. | ||
|
||
Named exports detection covers many common export patterns, reexport patterns | ||
and build tool and transpiler outputs. See [cjs-module-lexer][] for the exact | ||
semantics implemented. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,26 @@ | ||
|
||
<!-- type=misc --> | ||
|
||
Experimental support for ECMAScript modules is enabled by default. | ||
Node.js will treat the following as ES modules when passed to `node` as the | ||
initial input, or when referenced by `import` statements within ES module code: | ||
|
||
* Files ending in `.mjs`. | ||
|
||
* Files ending in `.js` when the nearest parent `package.json` file contains a | ||
top-level field `"type"` with a value of `"module"`. | ||
|
||
* Strings passed in as an argument to `--eval`, or piped to `node` via `STDIN`, | ||
with the flag `--input-type=module`. | ||
|
||
Node.js will treat as CommonJS all other forms of input, such as `.js` files | ||
where the nearest parent `package.json` file contains no top-level `"type"` | ||
field, or string input without the flag `--input-type`. This behavior is to | ||
preserve backward compatibility. However, now that Node.js supports both | ||
CommonJS and ES modules, it is best to be explicit whenever possible. Node.js | ||
will treat the following as CommonJS when passed to `node` as the initial input, | ||
or when referenced by `import` statements within ES module code: | ||
|
||
* Files ending in `.cjs`. | ||
|
||
* Files ending in `.js` when the nearest parent `package.json` file contains a | ||
top-level field `"type"` with a value of `"commonjs"`. | ||
|
||
* Strings passed in as an argument to `--eval` or `--print`, or piped to `node` | ||
via `STDIN`, with the flag `--input-type=commonjs`. | ||
Node.js treats JavaScript code as CommonJS modules by default. | ||
Authors can tell Node.js to treat JavaScript code as ECMAScript modules | ||
via the `.mjs` file extension, the `package.json` [`"type"`][] field, or the | ||
`--input-type` flag. See | ||
[Modules: Packages](packages.html#packages_determining_module_system) for more | ||
details. | ||
|
||
<!-- Anchors to make sure old links find a target --> | ||
<i id="esm_package_entry_points"></i> | ||
<i id="esm_main_entry_point_export"></i> | ||
<i id="esm_subpath_exports"></i> | ||
<i id="esm_package_exports_fallbacks"></i> | ||
<i id="esm_exports_sugar"></i> | ||
<i id="esm_conditional_exports"></i> | ||
<i id="esm_nested_conditions"></i> | ||
<i id="esm_self_referencing_a_package_using_its_name"></i> | ||
<i id="esm_internal_package_imports"></i> | ||
<i id="esm_dual_commonjs_es_module_packages"></i> | ||
<i id="esm_dual_package_hazard"></i> | ||
<i id="esm_writing_dual_packages_while_avoiding_or_minimizing_hazards"></i> | ||
<i id="esm_approach_1_use_an_es_module_wrapper"></i> | ||
<i id="esm_approach_2_isolate_state"></i> | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.