mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 21:46:48 +00:00
doc: fix typos
PR-URL: https://github.com/nodejs/node/pull/55066 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
4062b3fb43
commit
22b4b7c626
@ -5968,7 +5968,7 @@ See the [list of SSL OP Flags][] for details.
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>ENGINE_METHOD_PKEY_METHS</code></td>
|
<td><code>ENGINE_METHOD_PKEY_METHS</code></td>
|
||||||
<td>Limit engine usage to PKEY_METHDS</td>
|
<td>Limit engine usage to PKEY_METHS</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>ENGINE_METHOD_PKEY_ASN1_METHS</code></td>
|
<td><code>ENGINE_METHOD_PKEY_ASN1_METHS</code></td>
|
||||||
|
@ -142,14 +142,14 @@ If `cacheDir` is not specified, Node.js will either use the directory specified
|
|||||||
[`NODE_COMPILE_CACHE=dir`][] environment variable if it's set, or use
|
[`NODE_COMPILE_CACHE=dir`][] environment variable if it's set, or use
|
||||||
`path.join(os.tmpdir(), 'node-compile-cache')` otherwise. For general use cases, it's
|
`path.join(os.tmpdir(), 'node-compile-cache')` otherwise. For general use cases, it's
|
||||||
recommended to call `module.enableCompileCache()` without specifying the `cacheDir`,
|
recommended to call `module.enableCompileCache()` without specifying the `cacheDir`,
|
||||||
so that the directory can be overriden by the `NODE_COMPILE_CACHE` environment
|
so that the directory can be overridden by the `NODE_COMPILE_CACHE` environment
|
||||||
variable when necessary.
|
variable when necessary.
|
||||||
|
|
||||||
Since compile cache is supposed to be a quiet optimization that is not required for the
|
Since compile cache is supposed to be a quiet optimization that is not required for the
|
||||||
application to be functional, this method is designed to not throw any exception when the
|
application to be functional, this method is designed to not throw any exception when the
|
||||||
compile cache cannot be enabled. Instead, it will return an object containing an error
|
compile cache cannot be enabled. Instead, it will return an object containing an error
|
||||||
message in the `message` field to aid debugging.
|
message in the `message` field to aid debugging.
|
||||||
If compile cache is enabled successefully, the `directory` field in the returned object
|
If compile cache is enabled successfully, the `directory` field in the returned object
|
||||||
contains the path to the directory where the compile cache is stored. The `status`
|
contains the path to the directory where the compile cache is stored. The `status`
|
||||||
field in the returned object would be one of the `module.constants.compileCacheStatus`
|
field in the returned object would be one of the `module.constants.compileCacheStatus`
|
||||||
values to indicate the result of the attempt to enable the [module compile cache][].
|
values to indicate the result of the attempt to enable the [module compile cache][].
|
||||||
@ -157,7 +157,7 @@ values to indicate the result of the attempt to enable the [module compile cache
|
|||||||
This method only affects the current Node.js instance. To enable it in child worker threads,
|
This method only affects the current Node.js instance. To enable it in child worker threads,
|
||||||
either call this method in child worker threads too, or set the
|
either call this method in child worker threads too, or set the
|
||||||
`process.env.NODE_COMPILE_CACHE` value to compile cache directory so the behavior can
|
`process.env.NODE_COMPILE_CACHE` value to compile cache directory so the behavior can
|
||||||
be inheritend into the child workers. The directory can be obtained either from the
|
be inherited into the child workers. The directory can be obtained either from the
|
||||||
`directory` field returned by this method, or with [`module.getCompileCacheDir()`][].
|
`directory` field returned by this method, or with [`module.getCompileCacheDir()`][].
|
||||||
|
|
||||||
#### Module compile cache
|
#### Module compile cache
|
||||||
@ -264,7 +264,7 @@ changes:
|
|||||||
**Default:** `'data:'`
|
**Default:** `'data:'`
|
||||||
* `data` {any} Any arbitrary, cloneable JavaScript value to pass into the
|
* `data` {any} Any arbitrary, cloneable JavaScript value to pass into the
|
||||||
[`initialize`][] hook.
|
[`initialize`][] hook.
|
||||||
* `transferList` {Object\[]} [transferrable objects][] to be passed into the
|
* `transferList` {Object\[]} [transferable objects][] to be passed into the
|
||||||
`initialize` hook.
|
`initialize` hook.
|
||||||
|
|
||||||
Register a module that exports [hooks][] that customize Node.js module
|
Register a module that exports [hooks][] that customize Node.js module
|
||||||
@ -469,7 +469,7 @@ affect the other thread(s), and message channels must be used to communicate
|
|||||||
between the threads.
|
between the threads.
|
||||||
|
|
||||||
The `register` method can be used to pass data to an [`initialize`][] hook. The
|
The `register` method can be used to pass data to an [`initialize`][] hook. The
|
||||||
data passed to the hook may include transferrable objects like ports.
|
data passed to the hook may include transferable objects like ports.
|
||||||
|
|
||||||
```mjs
|
```mjs
|
||||||
import { register } from 'node:module';
|
import { register } from 'node:module';
|
||||||
@ -567,7 +567,7 @@ the hooks thread when the hooks module is initialized. Initialization happens
|
|||||||
when the hooks module is registered via [`register`][].
|
when the hooks module is registered via [`register`][].
|
||||||
|
|
||||||
This hook can receive data from a [`register`][] invocation, including
|
This hook can receive data from a [`register`][] invocation, including
|
||||||
ports and other transferrable objects. The return value of `initialize` can be a
|
ports and other transferable objects. The return value of `initialize` can be a
|
||||||
{Promise}, in which case it will be awaited before the main application thread
|
{Promise}, in which case it will be awaited before the main application thread
|
||||||
execution resumes.
|
execution resumes.
|
||||||
|
|
||||||
@ -1118,7 +1118,7 @@ Flush the [module compile cache][] accumulated from modules already loaded
|
|||||||
in the current Node.js instance to disk. This returns after all the flushing
|
in the current Node.js instance to disk. This returns after all the flushing
|
||||||
file system operations come to an end, no matter they succeed or not. If there
|
file system operations come to an end, no matter they succeed or not. If there
|
||||||
are any errors, this will fail silently, since compile cache misses should not
|
are any errors, this will fail silently, since compile cache misses should not
|
||||||
interfer with the actual operation of the application.
|
interfere with the actual operation of the application.
|
||||||
|
|
||||||
### Class: `module.SourceMap`
|
### Class: `module.SourceMap`
|
||||||
|
|
||||||
@ -1250,4 +1250,4 @@ returned object contains the following keys:
|
|||||||
[prefix-only modules]: modules.md#built-in-modules-with-mandatory-node-prefix
|
[prefix-only modules]: modules.md#built-in-modules-with-mandatory-node-prefix
|
||||||
[realm]: https://tc39.es/ecma262/#realm
|
[realm]: https://tc39.es/ecma262/#realm
|
||||||
[source map include directives]: https://sourcemaps.info/spec.html#h.lmz475t4mvbx
|
[source map include directives]: https://sourcemaps.info/spec.html#h.lmz475t4mvbx
|
||||||
[transferrable objects]: worker_threads.md#portpostmessagevalue-transferlist
|
[transferable objects]: worker_threads.md#portpostmessagevalue-transferlist
|
||||||
|
@ -171,7 +171,7 @@ There is the CommonJS module loader:
|
|||||||
`process.dlopen()`.
|
`process.dlopen()`.
|
||||||
* It treats all files that lack `.json` or `.node` extensions as JavaScript
|
* It treats all files that lack `.json` or `.node` extensions as JavaScript
|
||||||
text files.
|
text files.
|
||||||
* It can only be used to [load ECMASCript modules from CommonJS modules][] if
|
* It can only be used to [load ECMAScript modules from CommonJS modules][] if
|
||||||
the module graph is synchronous (that contains no top-level `await`).
|
the module graph is synchronous (that contains no top-level `await`).
|
||||||
When used to load a JavaScript text file that is not an ECMAScript module,
|
When used to load a JavaScript text file that is not an ECMAScript module,
|
||||||
the file will be loaded as a CommonJS module.
|
the file will be loaded as a CommonJS module.
|
||||||
@ -1423,7 +1423,7 @@ This field defines [subpath imports][] for the current package.
|
|||||||
[entry points]: #package-entry-points
|
[entry points]: #package-entry-points
|
||||||
[folders as modules]: modules.md#folders-as-modules
|
[folders as modules]: modules.md#folders-as-modules
|
||||||
[import maps]: https://github.com/WICG/import-maps
|
[import maps]: https://github.com/WICG/import-maps
|
||||||
[load ECMASCript modules from CommonJS modules]: modules.md#loading-ecmascript-modules-using-require
|
[load ECMAScript modules from CommonJS modules]: modules.md#loading-ecmascript-modules-using-require
|
||||||
[loader hooks]: esm.md#loaders
|
[loader hooks]: esm.md#loaders
|
||||||
[packages folder mapping]: https://github.com/WICG/import-maps#packages-via-trailing-slashes
|
[packages folder mapping]: https://github.com/WICG/import-maps#packages-via-trailing-slashes
|
||||||
[self-reference]: #self-referencing-a-package-using-its-name
|
[self-reference]: #self-referencing-a-package-using-its-name
|
||||||
|
@ -2235,7 +2235,7 @@ stopped by having passed a `signal` option and aborting the related
|
|||||||
`return`. In either case the stream will be destroyed.
|
`return`. In either case the stream will be destroyed.
|
||||||
|
|
||||||
This method is different from listening to the [`'data'`][] event in that it
|
This method is different from listening to the [`'data'`][] event in that it
|
||||||
uses the [`readable`][] event in the underlying machinary and can limit the
|
uses the [`readable`][] event in the underlying machinery and can limit the
|
||||||
number of concurrent `fn` calls.
|
number of concurrent `fn` calls.
|
||||||
|
|
||||||
```mjs
|
```mjs
|
||||||
|
@ -485,7 +485,7 @@ all tests have completed. If the [`NODE_V8_COVERAGE`][] environment variable is
|
|||||||
used to specify a code coverage directory, the generated V8 coverage files are
|
used to specify a code coverage directory, the generated V8 coverage files are
|
||||||
written to that directory. Node.js core modules and files within
|
written to that directory. Node.js core modules and files within
|
||||||
`node_modules/` directories are, by default, not included in the coverage report.
|
`node_modules/` directories are, by default, not included in the coverage report.
|
||||||
However, they can be explicity included via the [`--test-coverage-include`][] flag. If
|
However, they can be explicitly included via the [`--test-coverage-include`][] flag. If
|
||||||
coverage is enabled, the coverage report is sent to any [test reporters][] via
|
coverage is enabled, the coverage report is sent to any [test reporters][] via
|
||||||
the `'test:coverage'` event.
|
the `'test:coverage'` event.
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ console.log(queryObjects(B, { format: 'summary' }));
|
|||||||
|
|
||||||
// Note that, when there are child classes inheriting from a constructor,
|
// Note that, when there are child classes inheriting from a constructor,
|
||||||
// the constructor also shows up in the prototype chain of the child
|
// the constructor also shows up in the prototype chain of the child
|
||||||
// classes's prototoype, so the child classes's prototoype would also be
|
// classes's prototype, so the child classes's prototype would also be
|
||||||
// included in the result.
|
// included in the result.
|
||||||
console.log(queryObjects(A)); // 3
|
console.log(queryObjects(A)); // 3
|
||||||
// [ "B { foo: 'bar', bar: 'qux' }", 'A {}', "A { foo: 'bar' }" ]
|
// [ "B { foo: 'bar', bar: 'qux' }", 'A {}', "A { foo: 'bar' }" ]
|
||||||
@ -349,7 +349,7 @@ console.log(queryObjects(B, { format: 'summary' }));
|
|||||||
|
|
||||||
// Note that, when there are child classes inheriting from a constructor,
|
// Note that, when there are child classes inheriting from a constructor,
|
||||||
// the constructor also shows up in the prototype chain of the child
|
// the constructor also shows up in the prototype chain of the child
|
||||||
// classes's prototoype, so the child classes's prototoype would also be
|
// classes's prototype, so the child classes's prototype would also be
|
||||||
// included in the result.
|
// included in the result.
|
||||||
console.log(queryObjects(A)); // 3
|
console.log(queryObjects(A)); // 3
|
||||||
// [ "B { foo: 'bar', bar: 'qux' }", 'A {}', "A { foo: 'bar' }" ]
|
// [ "B { foo: 'bar', bar: 'qux' }", 'A {}', "A { foo: 'bar' }" ]
|
||||||
|
@ -10,9 +10,9 @@ through <https://scan9.scan.coverity.com/reports.htm>.
|
|||||||
Any collaborator can ask to be added to the Node.js coverity project
|
Any collaborator can ask to be added to the Node.js coverity project
|
||||||
by opening an issue in the [build][] repository titled
|
by opening an issue in the [build][] repository titled
|
||||||
`Please add me to coverity`. A member of the build WG with admin access will
|
`Please add me to coverity`. A member of the build WG with admin access will
|
||||||
verify that the requestor is an existing collaborator as listed in the
|
verify that the requester is an existing collaborator as listed in the
|
||||||
[collaborators section][] on the nodejs/node project repo. Once validated the
|
[collaborators section][] on the nodejs/node project repo. Once validated the
|
||||||
requestor will be added to the coverity project.
|
requester will be added to the coverity project.
|
||||||
|
|
||||||
[Node.js coverity project]: https://scan.coverity.com/projects/node-js
|
[Node.js coverity project]: https://scan.coverity.com/projects/node-js
|
||||||
[build]: https://github.com/nodejs/build
|
[build]: https://github.com/nodejs/build
|
||||||
|
Loading…
Reference in New Issue
Block a user