Skip to content

Commit

Permalink
fix: 14.0.0-200426
Browse files Browse the repository at this point in the history
  • Loading branch information
h7lin committed Apr 26, 2020
1 parent 6190a16 commit c003b23
Show file tree
Hide file tree
Showing 228 changed files with 603 additions and 616 deletions.
2 changes: 1 addition & 1 deletion addons/c_addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

实现插件有三种选择:N-API、nan、或直接使用内部的 V8、libuv Node.js 库。
除非需要直接访问 N-API 未公开的函数,否则请使用 N-API。
有关 N-API 的更多信息,参阅[具有 N-API C/C++ 插件][_n-api]
有关 N-API 的更多信息,参见[具有 N-API C/C++ 插件][_n-api]

当不使用 N-API 时,实现插件很复杂,涉及多个组件和 API 的知识:

Expand Down
2 changes: 1 addition & 1 deletion addons/n_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ NAPI_MODULE(NODE_GYP_MODULE_NAME, init)
} // namespace demo
```

可用的函数和使用文档请参阅[具有 N-API C/C++ 插件][_n-api]
可用的函数和使用文档请参见[具有 N-API C/C++ 插件][_n-api]

2 changes: 1 addition & 1 deletion assert/assert_fail_message.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ assert.fail(new TypeError('需要数组'));
```

使用带有两个以上参数的 `assert.fail()` 是可能的,但已弃用。
请参阅下文了解更多详情
请参见下文了解更多详情


2 changes: 1 addition & 1 deletion assert/assert_ok_value_message.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ changes:
如果 `message` 参数是 [`Error`] 的实例,则它将被抛出而不是 `AssertionError`
如果没有传入任何参数,则将 `message` 设置为字符串:``'No value argument passed to `assert.ok()`'``

注意,在 `repl` 中,错误消息将与文件中抛出的错误消息不同!请参阅下文了解更多详情
注意,在 `repl` 中,错误消息将与文件中抛出的错误消息不同!请参见下文了解更多详情

```js
const assert = require('assert').strict;
Expand Down
2 changes: 1 addition & 1 deletion assert/assert_throws_fn_error_message.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ changes:

如果指定,则 `error` 可以是 [`Class`][`RegExp`]、验证函数,每个属性将被测试严格的深度相等的验证对象、或每个属性(包括不可枚举的 `message` `name` 属性)将被测试严格的深度相等的错误实例。
使用对象时,还可以在对字符串属性进行验证时使用正则表达式。
请参阅下面的示例
请参见下面的示例

如果指定 `message`,则当 `fn` 调用无法抛出或错误验证失败时,`message` 将附加到 `AssertionError` 提供的消息。

Expand Down
2 changes: 1 addition & 1 deletion assert/comparison_details_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* `Object` 属性的比较是无序的。
* [`Map`] 键名与 [`Set`] 子项的比较是无序的。
* 当两边的值不相同或遇到循环引用时,递归停止。
* [`WeakMap`] [`WeakSet`] 的比较不依赖于它们的值。请参阅下文了解更多详情
* [`WeakMap`] [`WeakSet`] 的比较不依赖于它们的值。请参见下文了解更多详情

```js
const assert = require('assert').strict;
Expand Down
2 changes: 1 addition & 1 deletion assert/strict_assertion_mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);

要停用颜色,则使用 `NO_COLOR` `NODE_DISABLE_COLORS` 环境变量。
这也将停用 REPL 中的颜色。
有关终端环境中颜色支持的更多信息,参阅 [getColorDepth()][_tty_writestream_getcolordepth] 文档。
有关终端环境中颜色支持的更多信息,参见 [getColorDepth()][_tty_writestream_getcolordepth] 文档。

2 changes: 1 addition & 1 deletion buffer/buf_buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* {ArrayBuffer} 创建此 `Buffer` 对象时基于的底层 `ArrayBuffer` 对象。

不能保证此 `ArrayBuffer` 与原始的 `Buffer` 完全对应。
有关详细信息,参阅 `buf.byteOffset` 上的说明。
有关详细信息,参见 `buf.byteOffset` 上的说明。

```js
const arrayBuffer = new ArrayBuffer(16);
Expand Down
2 changes: 1 addition & 1 deletion buffer/buffer_inspect_max_bytes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ added: v0.5.4

返回当调用 `buf.inspect()` 时将会返回的最大字节数。
这可以被用户模块重写。
有关 `buf.inspect()` 行为的更多详细信息,参阅 [`util.inspect()`]
有关 `buf.inspect()` 行为的更多详细信息,参见 [`util.inspect()`]

该属性是在 `require('buffer')` 返回的 `buffer` 模块上,而不是在 `Buffer` 全局变量或 `Buffer` 实例上。

2 changes: 1 addition & 1 deletion buffer/buffers_and_character_encodings.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Node.js 还支持以下两种二进制转文本的编码。

* `'hex'`: 将每个字节编码成两个十六进制的字符。
当解码仅包含有效的十六进制字符的字符串时,可能会发生数据截断。
请参阅下面的示例
请参见下面的示例

还支持以下遗留的字符编码:

Expand Down
2 changes: 1 addition & 1 deletion buffer/class_method_buffer_allocunsafe_size.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ console.log(buf);

如果 `size` 不是一个数字,则抛出 `TypeError`

`Buffer` 模块会预分配一个内部的大小为 [`Buffer.poolSize`] `Buffer` 实例,作为快速分配的内存池,用于使用 [`Buffer.allocUnsafe()`] 创建新的 `Buffer` 实例、或 [`Buffer.from(array)`]或废弃的 `new Buffer(size)` 构造器但仅当 `size` 小于或等于 `Buffer.poolSize >> 1`[`Buffer.poolSize`] 除以二再向下取整)。
`Buffer` 模块会预分配一个内部的大小为 [`Buffer.poolSize`] `Buffer` 实例,作为快速分配的内存池,用于使用 [`Buffer.allocUnsafe()`] 创建新的 `Buffer` 实例、或 [`Buffer.from(array)`]或弃用的 `new Buffer(size)` 构造器但仅当 `size` 小于或等于 `Buffer.poolSize >> 1`[`Buffer.poolSize`] 除以二再向下取整)。

对这个预分配的内部内存池的使用是调用 `Buffer.alloc(size, fill)` `Buffer.allocUnsafe(size).fill(fill)` 两者之间的关键区别。
具体来说,`Buffer.alloc(size, fill)` 永远不会使用内部的 `Buffer` 池,而 `Buffer.allocUnsafe(size).fill(fill)` `size` 小于或等于 [`Buffer.poolSize`] 的一半时将会使用内部的 `Buffer`池。
Expand Down
2 changes: 1 addition & 1 deletion buffer/class_method_buffer_compare_buf1_buf2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ changes:

* `buf1` {Buffer|Uint8Array}
* `buf2` {Buffer|Uint8Array}
* 返回: {integer} `-1``0` `1`,取决于比较的结果。 有关详细信息,参阅 [`buf.compare()`]
* 返回: {integer} `-1``0` `1`,取决于比较的结果。 有关详细信息,参见 [`buf.compare()`]

比较 `buf1` `buf2`,主要用于 `Buffer` 实例数组的排序。
相当于调用 [`buf1.compare(buf2)`][`buf.compare()`]
Expand Down
8 changes: 4 additions & 4 deletions child_process/child_process_exec_command_options_callback.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ changes:
* `cwd` {string} 子进程的当前工作目录。**默认值:** `null`
* `env` {Object} 环境变量的键值对。**默认值:** `process.env`
* `encoding` {string} **默认值:** `'utf8'`
* `shell` {string} 用于执行命令的 shell。参阅 [shell 的要求][Shell Requirements] [Windows 默认的 shell][Default Windows Shell]
* `shell` {string} 用于执行命令的 shell。参见 [shell 的要求][Shell Requirements] [Windows 默认的 shell][Default Windows Shell]
**默认值:** Unix 上是 `'/bin/sh'`,Windows 上是 `process.env.ComSpec`
* `timeout` {number} **默认值:** `0`
* `maxBuffer` {number} stdout stderr 上允许的最大字节数。如果超过限制,则子进程会被终止并且截断任何输出。参阅 [maxBuffer Unicode][`maxBuffer` and Unicode] 中的警告。**默认值:** `1024 * 1024`
* `maxBuffer` {number} stdout stderr 上允许的最大字节数。如果超过限制,则子进程会被终止并且截断任何输出。参见 [maxBuffer Unicode][`maxBuffer` and Unicode] 中的警告。**默认值:** `1024 * 1024`
* `killSignal` {string|integer} **默认值:** `'SIGTERM'`
* `uid` {number} 设置进程的用户标识,参阅 setuid(2)
* `gid` {number} 设置进程的群组标识,参阅 setgid(2)
* `uid` {number} 设置进程的用户标识,参见 setuid(2)
* `gid` {number} 设置进程的群组标识,参见 setgid(2)
* `windowsHide` {boolean} 隐藏子进程的控制台窗口(在 Windows 系统上通常会创建)。)。**默认值:** `false`
* `callback` {Function} 当进程终止时调用并带上输出。
* `error` {Error}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ changes:
* `env` {Object} 环境变量的键值对。**默认值:** `process.env`
* `encoding` {string} 字符编码。**默认值:** `'utf8'`
* `timeout` {number} **默认值:** `0`
* `maxBuffer` {number} stdout stderr 上允许的最大字节数。如果超过限制,则子进程会被终止并且截断任何输出。参阅 [maxBuffer Unicode][`maxBuffer` and Unicode] 中的警告。**默认值:** `1024 * 1024`
* `maxBuffer` {number} stdout stderr 上允许的最大字节数。如果超过限制,则子进程会被终止并且截断任何输出。参见 [maxBuffer Unicode][`maxBuffer` and Unicode] 中的警告。**默认值:** `1024 * 1024`
* `killSignal` {string|integer} **默认值:** `'SIGTERM'`
* `uid` {number} 设置进程的用户标识,参阅 setuid(2)
* `gid` {number} 设置进程的群组标识,参阅 setgid(2)
* `uid` {number} 设置进程的用户标识,参见 setuid(2)
* `gid` {number} 设置进程的群组标识,参见 setgid(2)
* `windowsHide` {boolean} 隐藏子进程的控制台窗口(在 Windows 系统上通常会创建)。**默认值:** `false`
* `windowsVerbatimArguments` {boolean} Windows 上不为参数加上引号或转义。在 Unix 上忽略。**默认值:** `false`
* `shell` {boolean|string} 如果为 `true`,则在 shell 中运行 `command`
Unix 上使用 `'/bin/sh'`,在 Windows 上使用 `process.env.ComSpec`
可以将不同的 shell 指定为字符串。
参阅 [shell 的要求][Shell Requirements] [Windows 默认的 shell][Default Windows Shell]
参见 [shell 的要求][Shell Requirements] [Windows 默认的 shell][Default Windows Shell]
**默认值:** `false`(没有 shell)。
* `callback` {Function} 当进程终止时调用并带上输出。
* `error` {Error}
Expand Down
8 changes: 4 additions & 4 deletions child_process/child_process_execfilesync_file_args_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ changes:
* `input` {string|Buffer|TypedArray|DataView} 该值将会作为 stdin 传给衍生的进程。提供此值将会覆盖 `stdio[0]`
* `stdio` {string|Array} 子进程的 stdio 配置。默认情况下,除非指定了 `stdio`,否则 `stderr` 将会被输出到父进程的 stderr。**默认值:** `'pipe'`
* `env` {Object} 环境变量的键值对。**默认值:** `process.env`
* `uid` {number} 设置进程的用户标识,参阅 setuid(2)
* `gid` {number} 设置进程的群组标识,参阅 setgid(2)
* `uid` {number} 设置进程的用户标识,参见 setuid(2)
* `gid` {number} 设置进程的群组标识,参见 setgid(2)
* `timeout` {number} 允许进程运行的最长时间,以毫秒为单位。**默认值:** `undefined`
* `killSignal` {string|integer} 当衍生的进程将被终止时使用的信号值。**默认值:** `'SIGTERM'`
* `maxBuffer` {number} stdout stderr 上允许的最大字节数。如果超过限制,则子进程会被终止。参阅 [maxBuffer Unicode][`maxBuffer` and Unicode] 中的警告。**默认值:** `1024 * 1024`
* `maxBuffer` {number} stdout stderr 上允许的最大字节数。如果超过限制,则子进程会被终止。参见 [maxBuffer Unicode][`maxBuffer` and Unicode] 中的警告。**默认值:** `1024 * 1024`
* `encoding` {string} 用于所有 stdio 输入和输出的字符编码。**默认值:** `'buffer'`
* `windowsHide` {boolean} 隐藏子进程的控制台窗口(在 Windows 系统上通常会创建)。**默认值:** `false`
* `shell` {boolean|string} 如果为 `true`,则在 shell 中运行 `command`
Unix 上使用 `'/bin/sh'`,在 Windows 上使用 `process.env.ComSpec`
可以将不同的 shell 指定为字符串。
参阅 [shell 的要求][Shell Requirements] [Windows 默认的 shell][Default Windows Shell]
参见 [shell 的要求][Shell Requirements] [Windows 默认的 shell][Default Windows Shell]
**默认值:** `false`(没有 shell)。
* 返回: {Buffer|string} 命令的 stdout。

Expand Down
8 changes: 4 additions & 4 deletions child_process/child_process_execsync_command_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ changes:
* `input` {string|Buffer|TypedArray|DataView} 该值将会作为 stdin 传给衍生的进程。提供此值将会覆盖 `stdio[0]`
* `stdio` {string|Array} 子进程的 stdio 配置。默认情况下,除非指定了 `stdio`,否则 `stderr` 将会被输出到父进程的 stderr。**默认值:** `'pipe'`
* `env` {Object} 环境变量的键值对。**默认值:** `process.env`
* `shell` {string} 用于执行命令的 shell。参阅 [shell 的要求][Shell Requirements] [Windows 默认的 shell][Default Windows Shell]
* `shell` {string} 用于执行命令的 shell。参见 [shell 的要求][Shell Requirements] [Windows 默认的 shell][Default Windows Shell]
**默认值:** Unix 上是 `'/bin/sh'`,Windows 上是 `process.env.ComSpec`
* `uid` {number} 设置进程的用户标识,参阅 setuid(2)
* `gid` {number} 设置进程的群组标识,参阅 setgid(2)
* `uid` {number} 设置进程的用户标识,参见 setuid(2)
* `gid` {number} 设置进程的群组标识,参见 setgid(2)
* `timeout` {number} 允许进程运行的最长时间,以毫秒为单位。**默认值:** `undefined`
* `killSignal` {string|integer} 当衍生的进程将被终止时使用的信号值。**默认值:** `'SIGTERM'`
* `maxBuffer` {number} stdout stderr 上允许的最大字节数。如果超过限制,则子进程会被终止并且截断任何输出。参阅 [maxBuffer Unicode][`maxBuffer` and Unicode] 中的警告。**默认值:** `1024 * 1024`
* `maxBuffer` {number} stdout stderr 上允许的最大字节数。如果超过限制,则子进程会被终止并且截断任何输出。参见 [maxBuffer Unicode][`maxBuffer` and Unicode] 中的警告。**默认值:** `1024 * 1024`
* `encoding` {string} 用于所有 stdio 输入和输出的字符编码。**默认值:** `'buffer'`
* `windowsHide` {boolean} 隐藏子进程的控制台窗口(在 Windows 系统上通常会创建)。**默认值:** `false`
* 返回: {Buffer|string} 命令的 stdout。
Expand Down
10 changes: 5 additions & 5 deletions child_process/child_process_fork_modulepath_args_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ changes:
* `args` {string[]} 字符串参数的列表。
* `options` {Object}
* `cwd` {string} 子进程的当前工作目录。
* `detached` {boolean} 准备子进程独立于其父进程运行。具体行为取决于平台,参阅 [`options.detached`]
* `detached` {boolean} 准备子进程独立于其父进程运行。具体行为取决于平台,参见 [`options.detached`]
* `env` {Object} 环境变量的键值对。**默认值:** `process.env`
* `execPath` {string} 用于创建子进程的可执行文件。
* `execArgv` {string[]} 传给可执行文件的字符串参数的列表。**默认值:** `process.execArgv`
* `serialization` {string} 指定用于在进程之间发送消息的序列化类型。可能的值为 `'json'` `'advanced'`。有关更多详细信息,请参阅[高级序列化][Advanced Serialization]**默认值:** `'json'`
* `serialization` {string} 指定用于在进程之间发送消息的序列化类型。可能的值为 `'json'` `'advanced'`。有关更多详细信息,请参见[高级序列化][Advanced Serialization]**默认值:** `'json'`
* `silent` {boolean} 如果为 `true`,则子进程的 stdin、stdout stderr 将会被输送到父进程,否则它们将会继承自父进程,详见 [`child_process.spawn()`] [`stdio`] 中的 `'pipe'` `'inherit'` 选项。**默认值:** `false`
* `stdio` {Array|string} 参阅 [`child_process.spawn()`] [`stdio`]。当提供此选项时,则它覆盖 `silent` 选项。如果使用了数组变量,则它必须包含一个值为 `'ipc'` 的元素,否则将会抛出错误。例如 `[0, 1, 2, 'ipc']`
* `stdio` {Array|string} 参见 [`child_process.spawn()`] [`stdio`]。当提供此选项时,则它覆盖 `silent` 选项。如果使用了数组变量,则它必须包含一个值为 `'ipc'` 的元素,否则将会抛出错误。例如 `[0, 1, 2, 'ipc']`
* `windowsVerbatimArguments` {boolean} Windows 上不为参数加上引号或转义。在 Unix 上则忽略。**默认值:** `false`
* `uid` {number} 设置进程的用户标识,参阅 setuid(2)
* `gid` {number} 设置进程的群组标识,参阅 setgid(2)
* `uid` {number} 设置进程的用户标识,参见 setuid(2)
* `gid` {number} 设置进程的群组标识,参见 setgid(2)
* 返回: {ChildProcess}

`child_process.fork()` 方法是 [`child_process.spawn()`] 的一个特例,专门用于衍生新的 Node.js 进程。
Expand Down
12 changes: 6 additions & 6 deletions child_process/child_process_spawn_command_args_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ changes:
* `cwd` {string} 子进程的当前工作目录。
* `env` {Object} 环境变量的键值对。**默认值:** `process.env`
* `argv0` {string} 显式地设置发送给子进程的 `argv[0]` 的值。如果没有指定,则将会被设置为 `command` 的值。
* `stdio` {Array|string} 子进程的 stdio 配置。参阅 [`options.stdio`][`stdio`]
* `detached` {boolean} 准备子进程独立于其父进程运行。具体行为取决于平台,参阅 [`options.detached`]
* `uid` {number} 设置进程的用户标识,参阅 setuid(2)
* `gid` {number} 设置进程的群组标识,参阅 setgid(2)
* `serialization` {string} 指定用于在进程之间发送消息的序列化类型。可能的值为 `'json'` `'advanced'`。有关更多详细信息,请参阅[高级序列化][Advanced Serialization]**默认值:** `'json'`
* `stdio` {Array|string} 子进程的 stdio 配置。参见 [`options.stdio`][`stdio`]
* `detached` {boolean} 准备子进程独立于其父进程运行。具体行为取决于平台,参见 [`options.detached`]
* `uid` {number} 设置进程的用户标识,参见 setuid(2)
* `gid` {number} 设置进程的群组标识,参见 setgid(2)
* `serialization` {string} 指定用于在进程之间发送消息的序列化类型。可能的值为 `'json'` `'advanced'`。有关更多详细信息,请参见[高级序列化][Advanced Serialization]**默认值:** `'json'`
* `shell` {boolean|string} 如果为 `true`,则在 shell 中运行 `command`
Unix 上使用 `'/bin/sh'`,在 Windows 上使用 `process.env.ComSpec`
可以将不同的 shell 指定为字符串。
参阅 [shell 的要求][Shell Requirements] [Windows 默认的 shell][Default Windows Shell]
参见 [shell 的要求][Shell Requirements] [Windows 默认的 shell][Default Windows Shell]
**默认值:** `false`(没有 shell)。
* `windowsVerbatimArguments` {boolean} Windows 上不为参数加上引号或转义。在 Unix 上忽略。如果指定了 `shell` 并且是 CMD,则自动设为 `true`**默认值:** `false`
* `windowsHide` {boolean} 隐藏子进程的控制台窗口(在 Windows 系统上通常会创建)。**默认值:** `false`
Expand Down
Loading

0 comments on commit c003b23

Please sign in to comment.