Skip to content

Commit

Permalink
v8.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
h7lin committed Nov 4, 2017
1 parent acd6182 commit ef6f93d
Show file tree
Hide file tree
Showing 158 changed files with 647 additions and 408 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
- fs模块: [QC-L]
- module模块:[adrianzqt]
- net模块: [nodejh]
- path模块: [fengshadu]
- stream模块:[Yi-love]

## 撤销模块管理员
Expand All @@ -52,5 +51,4 @@
[QC-L]: https://github.com/QC-L
[adrianzqt]: https://github.com/adrianzqt
[nodejh]: https://github.com/nodejh
[fengshadu]: https://github.com/fengshadu
[Yi-love]: https://github.com/Yi-love
1 change: 0 additions & 1 deletion assert/__link.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[`Error`]: errors.html#errors_class_error
[`Error.captureStackTrace`]: errors.html#errors_error_capturestacktrace_targetobject_constructoropt
[`Map`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map
[`Object.is()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
Expand Down
2 changes: 1 addition & 1 deletion async_hooks/after_asyncid.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Called immediately after the callback specified in `before` is completed.

*Note:* If an uncaught exception occurs during execution of the callback then
*Note:* If an uncaught exception occurs during execution of the callback, then
`after` will run *after* the `'uncaughtException'` event is emitted or a
`domain`'s handler runs.

Expand Down
8 changes: 4 additions & 4 deletions async_hooks/async_hooks_createhook_callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ operation.
The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the
respective asynchronous event during a resource's lifetime.

All callbacks are optional. So, for example, if only resource cleanup needs to
be tracked then only the `destroy` callback needs to be passed. The
specifics of all functions that can be passed to `callbacks` is in the section
[`Hook Callbacks`][].
All callbacks are optional. For example, if only resource cleanup needs to
be tracked, then only the `destroy` callback needs to be passed. The
specifics of all functions that can be passed to `callbacks` is in the
[Hook Callbacks][] section.

```js
const async_hooks = require('async_hooks');
Expand Down
2 changes: 1 addition & 1 deletion async_hooks/asynchook_enable.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Enable the callbacks for a given `AsyncHook` instance. If no callbacks are
provided enabling is a noop.

The `AsyncHook` instance is by default disabled. If the `AsyncHook` instance
The `AsyncHook` instance is disabled by default. If the `AsyncHook` instance
should be enabled immediately after creation, the following pattern can be used.

```js
Expand Down
2 changes: 1 addition & 1 deletion async_hooks/asynchronous_context_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Only using `execution` to graph resource allocation results in the following:
TTYWRAP(6) -> Timeout(4) -> TIMERWRAP(5) -> TickObject(3) -> root(1)
```

The `TCPWRAP` is not part of this graph; even though it was the reason for
The `TCPWRAP` is not part of this graph, even though it was the reason for
`console.log()` being called. This is because binding to a port without a
hostname is a *synchronous* operation, but to maintain a completely asynchronous
API the user's callback is placed in a `process.nextTick()`.
Expand Down
4 changes: 2 additions & 2 deletions async_hooks/asyncresource_triggerasyncid.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ constructor.

[`after` callback]: #async_hooks_after_asyncid
[`before` callback]: #async_hooks_before_asyncid
[`destroy` callback]: #async_hooks_before_asyncid
[`Hook Callbacks`]: #async_hooks_hook_callbacks
[`destroy` callback]: #async_hooks_destroy_asyncid
[`init` callback]: #async_hooks_init_asyncid_type_triggerasyncid_resource
[Hook Callbacks]: #async_hooks_hook_callbacks
7 changes: 3 additions & 4 deletions async_hooks/asyncresource_type_triggerasyncid.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

* arguments
* `type` {string} The type of async event.
* `triggerAsyncId` {number} The ID of the execution context that created this
async event.
* `type` {string} The type of async event.
* `triggerAsyncId` {number} The ID of the execution context that created this
async event.

Example usage:

Expand Down
2 changes: 1 addition & 1 deletion async_hooks/before_asyncid.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The `before` callback will be called 0 to N times. The `before` callback
will typically be called 0 times if the asynchronous operation was cancelled
or, for example, if no connections are received by a TCP server. Persistent
asynchronous resources like a TCP server will typically call the `before`
callback multiple times, while other operations like `fs.open()` will only call
callback multiple times, while other operations like `fs.open()` will call
it only once.


2 changes: 1 addition & 1 deletion async_hooks/error_handling.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

If any `AsyncHook` callbacks throw, the application will print the stack trace
and exit. The exit path does follow that of an uncaught exception but
and exit. The exit path does follow that of an uncaught exception, but
all `uncaughtException` listeners are removed, thus forcing the process to
exit. The `'exit'` callbacks will still be called unless the application is run
with `--abort-on-uncaught-exception`, in which case a stack trace will be
Expand Down
2 changes: 1 addition & 1 deletion async_hooks/hook_callbacks.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Key events in the lifetime of asynchronous events have been categorized into
four areas: instantiation, before/after the callback is called, and when the
instance is destructed.
instance is destroyed.

2 changes: 1 addition & 1 deletion async_hooks/promiseresolve_asyncid.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ new Promise((resolve) => resolve(true)).then((a) => {});

calls the following callbacks:

```
```text
init for PROMISE with id 5, trigger id: 1
promise resolve 5 # corresponds to resolve(true)
init for PROMISE with id 6, trigger id: 5 # the Promise returned by then()
Expand Down
4 changes: 2 additions & 2 deletions async_hooks/resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ the value of `type`. For instance, for the `GETADDRINFOREQWRAP` resource type,
`resource` provides the hostname used when looking up the IP address for the
hostname in `net.Server.listen()`. The API for accessing this information is
currently not considered public, but using the Embedder API, users can provide
and document their own resource objects. Such a resource object could for
example contain the SQL query being executed.
and document their own resource objects. For example, such a resource object
could contain the SQL query being executed.

In the case of Promises, the `resource` object will have `promise` property
that refers to the Promise that is being initialized, and a `parentId` property
Expand Down
2 changes: 1 addition & 1 deletion async_hooks/triggerid.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The second `TCPWRAP` is the new connection from the client. When a new
connection is made the `TCPWrap` instance is immediately constructed. This
happens outside of any JavaScript stack (side note: a `executionAsyncId()` of `0`
means it's being executed from C++, with no JavaScript stack above it).
With only that information it would be impossible to link resources together in
With only that information, it would be impossible to link resources together in
terms of what caused them to be created, so `triggerAsyncId` is given the task of
propagating what resource is responsible for the new resource's existence.

4 changes: 2 additions & 2 deletions buffer/buf_writeintle_value_offset_bytelength_noassert.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ added: v0.11.15
```js
const buf = Buffer.allocUnsafe(6);
buf.writeUIntBE(0x1234567890ab, 0, 6);
buf.writeIntBE(0x1234567890ab, 0, 6);
// 输出: <Buffer 12 34 56 78 90 ab>
console.log(buf);
buf.writeUIntLE(0x1234567890ab, 0, 6);
buf.writeIntBE(0x1234567890ab, 0, 6);
// 输出: <Buffer ab 90 78 56 34 12>
console.log(buf);
Expand Down
1 change: 0 additions & 1 deletion child_process/__link.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[`Error`]: errors.html#errors_class_error
[`EventEmitter`]: events.html#events_class_eventemitter
[`JSON.stringify` spec]: https://tc39.github.io/ecma262/#sec-json.stringify
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
[`subprocess.connected`]: #child_process_subprocess_connected
[`subprocess.disconnect()`]: #child_process_subprocess_disconnect
[`subprocess.kill()`]: #child_process_subprocess_kill_signal
Expand Down
6 changes: 6 additions & 0 deletions child_process/child_process_exec_command_options_callback.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<!-- YAML
added: v0.1.90
changes:
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
-->

* `command` {string} 要运行的命令,用空格分隔参数。
Expand All @@ -18,6 +22,8 @@ added: v0.1.90
* `killSignal` {string|integer} 默认为 `'SIGTERM'`
* `uid` {number} 设置该进程的用户标识。(详见 setuid(2)
* `gid` {number} 设置该进程的组标识。(详见 setgid(2)
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* `callback` {Function} 当进程终止时调用,并带上输出。
* `error` {Error}
* `stdout` {string|Buffer}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<!-- YAML
added: v0.1.91
changes:
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
-->

* `file` {string} 要运行的可执行文件的名称或路径。
Expand All @@ -16,6 +20,8 @@ added: v0.1.91
* `killSignal` {string|integer} 默认为 `'SIGTERM'`
* `uid` {number} 设置该进程的用户标识。(详见 setuid(2)
* `gid` {number} 设置该进程的组标识。(详见 setgid(2)
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* `callback` {Function} 当进程终止时调用,并带上输出。
* `error` {Error}
* `stdout` {string|Buffer}
Expand Down
5 changes: 5 additions & 0 deletions child_process/child_process_execfilesync_file_args_options.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<!-- YAML
added: v0.11.12
changes:
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/10653
description: The `input` option can now be a `Uint8Array`.
Expand All @@ -27,6 +30,8 @@ changes:
如果超过限制,则子进程会被终止。
See caveat at [`maxBuffer` and Unicode][].
* `encoding` {string} 用于所有 stdio 输入和输出的编码。默认为 `'buffer'`
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* 返回: {Buffer|string} 该命令的 stdout。

`child_process.execFileSync()` 方法与 [`child_process.execFile()`] 基本相同,除了该方法直到子进程完全关闭后才返回。
Expand Down
5 changes: 5 additions & 0 deletions child_process/child_process_execsync_command_options.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<!-- YAML
added: v0.11.12
changes:
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/10653
description: The `input` option can now be a `Uint8Array`.
Expand All @@ -26,6 +29,8 @@ changes:
如果超过限制,则子进程会被终止。
See caveat at [`maxBuffer` and Unicode][].
* `encoding` {string} 用于所有 stdio 输入和输出的编码。默认为 `'buffer'`
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* 返回: {Buffer|string} 该命令的 stdout。

`child_process.execSync()` 方法与 [`child_process.exec()`] 基本相同,除了该方法直到子进程完全关闭后才返回。
Expand Down
5 changes: 5 additions & 0 deletions child_process/child_process_spawn_command_args_options.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<!-- YAML
added: v0.1.90
changes:
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
- version: v6.4.0
pr-url: https://github.com/nodejs/node/pull/7696
description: The `argv0` option is supported now.
Expand All @@ -27,6 +30,8 @@ changes:
一个不同的 shell 可以被指定为字符串。
See [Shell Requirements][] and [Default Windows Shell][].
默认为 `false`(没有 shell)。
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* 返回: {ChildProcess}

`child_process.spawn()` 方法使用给定的 `command` `args` 中的命令行参数来衍生一个新进程。
Expand Down
5 changes: 5 additions & 0 deletions child_process/child_process_spawnsync_command_args_options.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<!-- YAML
added: v0.11.12
changes:
- version: v8.8.0
pr-url: https://github.com/nodejs/node/pull/15380
description: The `windowsHide` option is supported now.
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/10653
description: The `input` option can now be a `Uint8Array`.
Expand Down Expand Up @@ -34,6 +37,8 @@ changes:
一个不同的 shell 可以被指定为字符串。
See [Shell Requirements][] and [Default Windows Shell][].
默认为 `false`(没有 shell)。
* `windowsHide` {boolean} Hide the subprocess console window that would
normally be created on Windows systems. **Default:** `false`.
* 返回: {Object}
* `pid` {number} 子进程的 pid。
* `output` {Array} stdio 输出返回的结果数组。
Expand Down
7 changes: 7 additions & 0 deletions cli/force_async_hooks_checks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- YAML
added: v8.8.0
-->

Enables runtime checks for `async_hooks`. These can also be enabled dynamically
by enabling one of the `async_hooks` hooks.

6 changes: 6 additions & 0 deletions cli/node_no_http2_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- YAML
added: v8.8.0
-->

When set to `1`, the `http2` module is suppressed.

Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ Example:

```js
const crypto = require('crypto');
crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => {
crypto.pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
if (err) throw err;
console.log(derivedKey.toString('hex')); // '3745e48...aa39b34'
console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ Example:

```js
const crypto = require('crypto');
const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512');
console.log(key.toString('hex')); // '3745e48...aa39b34'
const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
console.log(key.toString('hex')); // '3745e48...08d59ae'
```

An array of supported digest functions can be retrieved using
[`crypto.getHashes()`][].

1 change: 1 addition & 0 deletions crypto/crypto_privatedecrypt_privatekey_buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ added: v0.11.14
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
`RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
- `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the decrypted content.

Decrypts `buffer` with `privateKey`.

Expand Down
1 change: 1 addition & 0 deletions crypto/crypto_privateencrypt_privatekey_buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ added: v1.1.0
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or
`RSA_PKCS1_PADDING`.
- `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the encrypted content.

Encrypts `buffer` with `privateKey`.

Expand Down
20 changes: 20 additions & 0 deletions crypto/crypto_publicdecrypt_key_buffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- YAML
added: v1.1.0
-->
- `key` {Object | string}
- `key` {string} A PEM encoded public or private key.
- `passphrase` {string} An optional passphrase for the private key.
- `padding` {crypto.constants} An optional padding value defined in
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or
`RSA_PKCS1_PADDING`.
- `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the decrypted content.

Decrypts `buffer` with `key`.

`key` can be an object or a string. If `key` is a string, it is treated as
the key with no passphrase and will use `RSA_PKCS1_PADDING`.

Because RSA public keys can be derived from private keys, a private key may
be passed instead of a public key.

18 changes: 0 additions & 18 deletions crypto/crypto_publicdecrypt_publickey_buffer.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<!-- YAML
added: v0.11.14
-->
- `publicKey` {Object | string}
- `key` {string} A PEM encoded public key.
- `passphrase` {string} An optional passphrase for the public key.
- `key` {Object | string}
- `key` {string} A PEM encoded public or private key.
- `passphrase` {string} An optional passphrase for the private key.
- `padding` {crypto.constants} An optional padding value defined in
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
`RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
- `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the encrypted content.

Encrypts the content of `buffer` with `publicKey` and returns a new
Encrypts the content of `buffer` with `key` and returns a new
[`Buffer`][] with encrypted content.

`publicKey` can be an object or a string. If `publicKey` is a string, it is
treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`.
`key` can be an object or a string. If `key` is a string, it is treated as
the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`.

Because RSA public keys can be derived from private keys, a private key may
be passed instead of a public key.

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ef6f93d

Please sign in to comment.