doc: replace to Node.js
PR-URL: https://github.com/nodejs/node/pull/19056 Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
This commit is contained in:
parent
3ed363cb36
commit
35c7238bb7
@ -452,8 +452,8 @@ added: v8.0.0
|
|||||||
|
|
||||||
A space-separated list of command line options. `options...` are interpreted as
|
A space-separated list of command line options. `options...` are interpreted as
|
||||||
if they had been specified on the command line before the actual command line
|
if they had been specified on the command line before the actual command line
|
||||||
(so they can be overridden). Node will exit with an error if an option that is
|
(so they can be overridden). Node.js will exit with an error if an option
|
||||||
not allowed in the environment is used, such as `-p` or a script file.
|
that is not allowed in the environment is used, such as `-p` or a script file.
|
||||||
|
|
||||||
Node options that are allowed are:
|
Node options that are allowed are:
|
||||||
- `--enable-fips`
|
- `--enable-fips`
|
||||||
|
@ -610,7 +610,7 @@ a V8-inspector based CLI debugger available through `node inspect`.
|
|||||||
|
|
||||||
Type: End-of-Life
|
Type: End-of-Life
|
||||||
|
|
||||||
DebugContext has been removed in V8 and is not available in Node 10+.
|
DebugContext has been removed in V8 and is not available in Node.js 10+.
|
||||||
|
|
||||||
DebugContext was an experimental API.
|
DebugContext was an experimental API.
|
||||||
|
|
||||||
|
@ -80,7 +80,8 @@ wish to do programmatic things with the documentation.
|
|||||||
## Syscalls and man pages
|
## Syscalls and man pages
|
||||||
|
|
||||||
System calls like open(2) and read(2) define the interface between user programs
|
System calls like open(2) and read(2) define the interface between user programs
|
||||||
and the underlying operating system. Node functions which simply wrap a syscall,
|
and the underlying operating system. Node.js functions
|
||||||
|
which simply wrap a syscall,
|
||||||
like [`fs.open()`][], will document that. The docs link to the corresponding man
|
like [`fs.open()`][], will document that. The docs link to the corresponding man
|
||||||
pages (short for manual pages) which describe how the syscalls work.
|
pages (short for manual pages) which describe how the syscalls work.
|
||||||
|
|
||||||
|
@ -443,7 +443,7 @@ than crashing the program.
|
|||||||
|
|
||||||
## Domains and Promises
|
## Domains and Promises
|
||||||
|
|
||||||
As of Node 8.0.0, the handlers of Promises are run inside the domain in
|
As of Node.js 8.0.0, the handlers of Promises are run inside the domain in
|
||||||
which the call to `.then` or `.catch` itself was made:
|
which the call to `.then` or `.catch` itself was made:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
@ -106,7 +106,7 @@ fs.readFile('./foo.txt', (err, body) => {
|
|||||||
<!-- type=misc -->
|
<!-- type=misc -->
|
||||||
|
|
||||||
To customize the default module resolution, loader hooks can optionally be
|
To customize the default module resolution, loader hooks can optionally be
|
||||||
provided via a `--loader ./loader-name.mjs` argument to Node.
|
provided via a `--loader ./loader-name.mjs` argument to Node.js.
|
||||||
|
|
||||||
When hooks are used they only apply to ES module loading and not to any
|
When hooks are used they only apply to ES module loading and not to any
|
||||||
CommonJS modules loaded.
|
CommonJS modules loaded.
|
||||||
@ -150,7 +150,7 @@ module. This can be one of the following:
|
|||||||
| `"dynamic"` | Use a [dynamic instantiate hook][] |
|
| `"dynamic"` | Use a [dynamic instantiate hook][] |
|
||||||
|
|
||||||
For example, a dummy loader to load JavaScript restricted to browser resolution
|
For example, a dummy loader to load JavaScript restricted to browser resolution
|
||||||
rules with only JS file extension and Node builtin modules support could
|
rules with only JS file extension and Node.js builtin modules support could
|
||||||
be written:
|
be written:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
@ -600,7 +600,7 @@ The times in the stat object have the following semantics:
|
|||||||
set to an earlier value than the current `birthtime` using the
|
set to an earlier value than the current `birthtime` using the
|
||||||
utimes(2) system call.
|
utimes(2) system call.
|
||||||
|
|
||||||
Prior to Node v0.12, the `ctime` held the `birthtime` on Windows
|
Prior to Node.js v0.12, the `ctime` held the `birthtime` on Windows
|
||||||
systems. Note that as of v0.12, `ctime` is not "creation time", and
|
systems. Note that as of v0.12, `ctime` is not "creation time", and
|
||||||
on Unix systems, it never was.
|
on Unix systems, it never was.
|
||||||
|
|
||||||
@ -657,7 +657,8 @@ changes:
|
|||||||
pr-url: https://github.com/nodejs/node/pull/6534
|
pr-url: https://github.com/nodejs/node/pull/6534
|
||||||
description: The constants like `fs.R_OK`, etc which were present directly
|
description: The constants like `fs.R_OK`, etc which were present directly
|
||||||
on `fs` were moved into `fs.constants` as a soft deprecation.
|
on `fs` were moved into `fs.constants` as a soft deprecation.
|
||||||
Thus for Node `< v6.3.0` use `fs` to access those constants, or
|
Thus for Node.js `< v6.3.0` use `fs`
|
||||||
|
to access those constants, or
|
||||||
do something like `(fs.constants || fs).R_OK` to work with all
|
do something like `(fs.constants || fs).R_OK` to work with all
|
||||||
versions.
|
versions.
|
||||||
-->
|
-->
|
||||||
|
@ -3489,7 +3489,7 @@ napi_status napi_get_node_version(napi_env env,
|
|||||||
```
|
```
|
||||||
|
|
||||||
- `[in] env`: The environment that the API is invoked under.
|
- `[in] env`: The environment that the API is invoked under.
|
||||||
- `[out] version`: A pointer to version information for Node itself.
|
- `[out] version`: A pointer to version information for Node.js itself.
|
||||||
|
|
||||||
Returns `napi_ok` if the API succeeded.
|
Returns `napi_ok` if the API succeeded.
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<!--introduced_in=v7.7.0-->
|
<!--introduced_in=v7.7.0-->
|
||||||
|
|
||||||
Trace Event provides a mechanism to centralize tracing information generated by
|
Trace Event provides a mechanism to centralize tracing information generated by
|
||||||
V8, Node core, and userspace code.
|
V8, Node.js core, and userspace code.
|
||||||
|
|
||||||
Tracing can be enabled by passing the `--trace-events-enabled` flag when
|
Tracing can be enabled by passing the `--trace-events-enabled` flag when
|
||||||
starting a Node.js application.
|
starting a Node.js application.
|
||||||
@ -42,8 +42,9 @@ string that supports `${rotation}` and `${pid}`. For example:
|
|||||||
node --trace-events-enabled --trace-event-file-pattern '${pid}-${rotation}.log' server.js
|
node --trace-events-enabled --trace-event-file-pattern '${pid}-${rotation}.log' server.js
|
||||||
```
|
```
|
||||||
|
|
||||||
Starting with Node 10.0.0, the tracing system uses the same time source as the
|
Starting with Node.js 10.0.0, the tracing system uses the same time source
|
||||||
one used by `process.hrtime()` however the trace-event timestamps are expressed
|
as the one used by `process.hrtime()`
|
||||||
in microseconds, unlike `process.hrtime()` which returns nanoseconds.
|
however the trace-event timestamps are expressed in microseconds,
|
||||||
|
unlike `process.hrtime()` which returns nanoseconds.
|
||||||
|
|
||||||
[Performance API]: perf_hooks.html
|
[Performance API]: perf_hooks.html
|
||||||
|
@ -156,7 +156,7 @@ decompressed result is valid.
|
|||||||
|
|
||||||
<!--type=misc-->
|
<!--type=misc-->
|
||||||
|
|
||||||
From `zlib/zconf.h`, modified to node.js's usage:
|
From `zlib/zconf.h`, modified to Node.js's usage:
|
||||||
|
|
||||||
The memory requirements for deflate are (in bytes):
|
The memory requirements for deflate are (in bytes):
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# Building Node with Ninja
|
# Building Node.js with Ninja
|
||||||
|
|
||||||
The purpose of this guide is to show how to build Node.js using [Ninja][], as
|
The purpose of this guide is to show how to build Node.js using [Ninja][], as
|
||||||
doing so can be significantly quicker than using `make`. Please see
|
doing so can be significantly quicker than using `make`. Please see
|
||||||
[Ninja's site][Ninja] for installation instructions (unix only).
|
[Ninja's site][Ninja] for installation instructions (unix only).
|
||||||
|
|
||||||
To build Node with ninja, there are 3 steps that must be taken:
|
To build Node.js with ninja, there are 3 steps that must be taken:
|
||||||
|
|
||||||
1. Configure the project's OS-based build rules via `./configure --ninja`.
|
1. Configure the project's OS-based build rules via `./configure --ninja`.
|
||||||
2. Run `ninja -C out/Release` to produce a compiled release binary.
|
2. Run `ninja -C out/Release` to produce a compiled release binary.
|
||||||
@ -27,7 +27,7 @@ compile much faster than even `make -j4` (or
|
|||||||
## Considerations
|
## Considerations
|
||||||
|
|
||||||
Ninja builds vary slightly from `make` builds. If you wish to run `make test`
|
Ninja builds vary slightly from `make` builds. If you wish to run `make test`
|
||||||
after, `make` will likely still need to rebuild some amount of Node.
|
after, `make` will likely still need to rebuild some amount of Node.js.
|
||||||
|
|
||||||
As such, if you wish to run the tests, it can be helpful to invoke the test
|
As such, if you wish to run the tests, it can be helpful to invoke the test
|
||||||
runner directly, like so:
|
runner directly, like so:
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
Postmortem metadata are constants present in the final build which can be used
|
Postmortem metadata are constants present in the final build which can be used
|
||||||
by debuggers and other tools to navigate through internal structures of software
|
by debuggers and other tools to navigate through internal structures of software
|
||||||
when analyzing its memory (either on a running process or a core dump). Node
|
when analyzing its memory (either on a running process or a core dump). Node.js
|
||||||
provides this metadata in its builds for V8 and Node internal structures.
|
provides this metadata in its builds for V8 and Node.js internal structures.
|
||||||
|
|
||||||
|
|
||||||
### V8 Postmortem metadata
|
### V8 Postmortem metadata
|
||||||
@ -11,9 +11,9 @@ provides this metadata in its builds for V8 and Node internal structures.
|
|||||||
V8 prefixes all postmortem constants with `v8dbg_`, and they allow inspection of
|
V8 prefixes all postmortem constants with `v8dbg_`, and they allow inspection of
|
||||||
objects on the heap as well as object properties and references. V8 generates
|
objects on the heap as well as object properties and references. V8 generates
|
||||||
those symbols with a script (`deps/v8/tools/gen-postmortem-metadata.py`), and
|
those symbols with a script (`deps/v8/tools/gen-postmortem-metadata.py`), and
|
||||||
Node always includes these constants in the final build.
|
Node.js always includes these constants in the final build.
|
||||||
|
|
||||||
### Node Debug Symbols
|
### Node.js Debug Symbols
|
||||||
|
|
||||||
Node prefixes all postmortem constants with `nodedbg_`, and they complement V8
|
Node prefixes all postmortem constants with `nodedbg_`, and they complement V8
|
||||||
constants by providing ways to inspect Node-specific structures, like
|
constants by providing ways to inspect Node-specific structures, like
|
||||||
@ -24,8 +24,9 @@ time.
|
|||||||
|
|
||||||
#### Calculating offset of class members
|
#### Calculating offset of class members
|
||||||
|
|
||||||
Node constants referring to the offset of class members in memory are calculated
|
Node.js constants referring to the offset of class members in memory
|
||||||
at compile time. Because of that, those class members must be at a fixed offset
|
are calculated at compile time.
|
||||||
|
Because of that, those class members must be at a fixed offset
|
||||||
from the start of the class. That's not a problem in most cases, but it also
|
from the start of the class. That's not a problem in most cases, but it also
|
||||||
means that those members should always come after any templated member on the
|
means that those members should always come after any templated member on the
|
||||||
class definition.
|
class definition.
|
||||||
|
@ -365,7 +365,7 @@ The test can be executed by running the `cctest` target:
|
|||||||
$ make cctest
|
$ make cctest
|
||||||
```
|
```
|
||||||
|
|
||||||
### Node test fixture
|
### Node.js test fixture
|
||||||
There is a [test fixture][] named `node_test_fixture.h` which can be included by
|
There is a [test fixture][] named `node_test_fixture.h` which can be included by
|
||||||
unit tests. The fixture takes care of setting up the Node.js environment
|
unit tests. The fixture takes care of setting up the Node.js environment
|
||||||
and tearing it down after the tests have finished.
|
and tearing it down after the tests have finished.
|
||||||
|
@ -20,9 +20,9 @@ internationalization functionality.
|
|||||||
|
|
||||||
## How to upgrade ICU
|
## How to upgrade ICU
|
||||||
|
|
||||||
- Make sure your node workspace is clean (clean `git status`) should be
|
- Make sure your Node.js workspace is clean (clean `git status`) should be
|
||||||
sufficient.
|
sufficient.
|
||||||
- Configure Node with the specific [ICU version](http://icu-project.org/download)
|
- Configure Node.js with the specific [ICU version](http://icu-project.org/download)
|
||||||
you want to upgrade to, for example:
|
you want to upgrade to, for example:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@ -40,7 +40,7 @@ make
|
|||||||
- Specifically, look for the lists in `sources!` in the `icu-generic.gyp` for
|
- Specifically, look for the lists in `sources!` in the `icu-generic.gyp` for
|
||||||
files to exclude.
|
files to exclude.
|
||||||
|
|
||||||
- Verify the node build works:
|
- Verify the Node.js build works:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
make test-ci
|
make test-ci
|
||||||
@ -62,7 +62,7 @@ new Intl.DateTimeFormat('es', {month: 'long'}).format(new Date(9E8));
|
|||||||
python tools/icu/shrink-icu-src.py
|
python tools/icu/shrink-icu-src.py
|
||||||
```
|
```
|
||||||
|
|
||||||
- Now, do a clean rebuild of node to test:
|
- Now, do a clean rebuild of Node.js to test:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
make -k distclean
|
make -k distclean
|
||||||
@ -84,7 +84,7 @@ new Intl.DateTimeFormat('es', {month: 'long'}).format(new Date(9E8));
|
|||||||
You are ready to check in the updated `deps/small-icu`. This is a big commit,
|
You are ready to check in the updated `deps/small-icu`. This is a big commit,
|
||||||
so make this a separate commit from the smaller changes.
|
so make this a separate commit from the smaller changes.
|
||||||
|
|
||||||
- Now, rebuild the Node license.
|
- Now, rebuild the Node.js license.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# clean up - remove deps/icu
|
# clean up - remove deps/icu
|
||||||
@ -116,7 +116,7 @@ make test-ci
|
|||||||
|
|
||||||
## Postscript about the tools
|
## Postscript about the tools
|
||||||
|
|
||||||
The files in this directory were written for the node.js effort.
|
The files in this directory were written for the Node.js effort.
|
||||||
It was the intent of their author (Steven R. Loomis / srl295) to
|
It was the intent of their author (Steven R. Loomis / srl295) to
|
||||||
merge them upstream into ICU, pending much discussion within the
|
merge them upstream into ICU, pending much discussion within the
|
||||||
ICU-TC.
|
ICU-TC.
|
||||||
@ -125,7 +125,7 @@ ICU-TC.
|
|||||||
configuration file for the `icutrim.py` script. `icutrim.py` and
|
configuration file for the `icutrim.py` script. `icutrim.py` and
|
||||||
`iculslocs.cpp` may themselves be superseded by components built into
|
`iculslocs.cpp` may themselves be superseded by components built into
|
||||||
ICU in the future. As of this writing, however, the tools are separate
|
ICU in the future. As of this writing, however, the tools are separate
|
||||||
entities within Node, although theyare being scrutinized by interested
|
entities within Node.js, although theyare being scrutinized by interested
|
||||||
members of the ICU-TC. The “upstream” ICU bugs are given below.
|
members of the ICU-TC. The “upstream” ICU bugs are given below.
|
||||||
|
|
||||||
* [#10919](http://bugs.icu-project.org/trac/ticket/10919)
|
* [#10919](http://bugs.icu-project.org/trac/ticket/10919)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user