Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V15.md#15.8.0">15.8.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V15.md#15.9.0">15.9.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V15.md#15.8.0">15.8.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V15.md#15.7.0">15.7.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V15.md#15.6.0">15.6.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V15.md#15.5.1">15.5.1</a><br/>
Expand Down
4 changes: 4 additions & 0 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ class MyAddedCallbacks extends MyAsyncCallbacks {
const asyncHook = async_hooks.createHook(new MyAddedCallbacks());
```

Because promises are asynchronous resources whose lifecycle is tracked
via the async hooks mechanism, the `init()`, `before()`, `after()`, and
`destroy()` callbacks *must not* be async functions that return promises.

##### Error handling

If any `AsyncHook` callbacks throw, the application will print the stack trace
Expand Down
4 changes: 2 additions & 2 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ keys.
<!-- YAML
added: v11.6.0
changes:
- version: REPLACEME
- version: v15.9.0
pr-url: https://github.com/nodejs/node/pull/37081
description: Added support for `'jwk'` format.
-->
Expand Down Expand Up @@ -1844,7 +1844,7 @@ The issuer identification included in this certificate.

### `x509.issuerCertificate`
<!-- YAML
added: REPLACEME
added: v15.9.0
-->

* Type: {X509Certificate}
Expand Down
6 changes: 3 additions & 3 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ The `atime` and `mtime` arguments follow these rules:

### `fsPromises.watch(filename[, options])`
<!-- YAML
added: REPLACEME
added: v15.9.0
-->

* `filename` {string|Buffer|URL}
Expand Down Expand Up @@ -1699,7 +1699,7 @@ See the POSIX chown(2) documentation for more detail.
<!-- YAML
added: v0.0.2
changes:
- version: REPLACEME
- version: v15.9.0
pr-url: https://github.com/nodejs/node/pull/37174
description: A default callback is now used if one is not provided.
- version: v10.0.0
Expand Down Expand Up @@ -3508,7 +3508,7 @@ The `atime` and `mtime` arguments follow these rules:
<!-- YAML
added: v0.5.10
changes:
- version: REPLACEME
- version: v15.9.0
pr-url: https://github.com/nodejs/node/pull/37190
description: Added support for closing the watcher with an AbortSignal.
- version: v7.6.0
Expand Down
2 changes: 1 addition & 1 deletion doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5963,7 +5963,7 @@ This API may only be called from the main thread.
## node_api_get_module_file_name

<!-- YAML
added: REPLACEME
added: v15.9.0
-->

> Stability: 1 - Experimental
Expand Down
8 changes: 4 additions & 4 deletions doc/api/perf_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ performance.mark('meow');

## `perf_hooks.createHistogram([options])`
<!-- YAML
added: REPLACEME
added: v15.9.0
-->

* `options` {Object}
Expand Down Expand Up @@ -814,19 +814,19 @@ implement the `enable()` and `disable()` methods.

## Class: `RecordableHistogram extends Histogram`
<!-- YAML
added: REPLACEME
added: v15.9.0
-->

### `histogram.record(val)`
<!-- YAML
added: REPLACEME
added: v15.9.0
-->

* `val` {number|bigint} The amount to record in the histogram.

### `histogram.recordDelta()`
<!-- YAML
added: REPLACEME
added: v15.9.0
-->

Calculates the amount of time (in nanoseconds) that has passed since the
Expand Down
30 changes: 29 additions & 1 deletion doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1719,7 +1719,11 @@ pipeline(
);
```

The `pipeline` API provides promise version:
The `pipeline` API provides a promise version, which can also
receive an options argument as the last parameter with a
`signal` {AbortSignal} property. When the signal is aborted,
`destroy` will be called on the underlying pipeline, with an
`AbortError`.

```js
const { pipeline } = require('stream/promises');
Expand All @@ -1736,6 +1740,30 @@ async function run() {
run().catch(console.error);
```

To use an `AbortSignal`, pass it inside an options object,
as the last argument:

```js
const { pipeline } = require('stream/promises');

async function run() {
const ac = new AbortController();
const options = {
signal: ac.signal,
};

setTimeout(() => ac.abort(), 1);
await pipeline(
fs.createReadStream('archive.tar'),
zlib.createGzip(),
fs.createWriteStream('archive.tar.gz'),
options,
);
}

run().catch(console.error); // AbortError
```

The `pipeline` API also supports async generators:

```js
Expand Down
2 changes: 1 addition & 1 deletion doc/api/timers.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ added: v15.0.0

### `timersPromises.setInterval([delay[, value[, options]]])`
<!-- YAML
added: REPLACEME
added: v15.9.0
-->

Returns an async iterator that generates values in an interval of `delay` ms.
Expand Down
4 changes: 2 additions & 2 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ to implement the `tls-unique` channel binding from [RFC 5929][].

### `tlsSocket.getPeerX509Certificate()`
<!-- YAML
added: REPLACEME
added: v15.9.0
-->

* Returns: {X509Certificate}
Expand Down Expand Up @@ -1227,7 +1227,7 @@ See [Session Resumption][] for more information.

### `tlsSocket.getX509Certificate()`
<!-- YAML
added: REPLACEME
added: v15.9.0
-->

* Returns: {X509Certificate}
Expand Down
2 changes: 1 addition & 1 deletion doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ const vm = require('vm');
<!-- YAML
added: v10.10.0
changes:
- version: REPLACEME
- version: v15.9.0
pr-url: https://github.com/nodejs/node/pull/35431
description: Added `importModuleDynamically` option again.
- version: v14.3.0
Expand Down
4 changes: 2 additions & 2 deletions doc/api/webcrypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ The algorithms currently supported include:
<!-- YAML
added: v15.0.0
changes:
- version: REPLACEME
- version: v15.9.0
pr-url: https://github.com/nodejs/node/pull/37203
description: Removed `'NODE-DSA'` JWK export.
-->
Expand Down Expand Up @@ -697,7 +697,7 @@ The {CryptoKey} (secret key) generating algorithms supported include:
<!-- YAML
added: v15.0.0
changes:
- version: REPLACEME
- version: v15.9.0
pr-url: https://github.com/nodejs/node/pull/37203
description: Removed `'NODE-DSA'` JWK import.
-->
Expand Down
2 changes: 1 addition & 1 deletion doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ are part of the channel.
<!-- YAML
added: v10.5.0
changes:
- version: REPLACEME
- version: v15.9.0
pr-url: https://github.com/nodejs/node/pull/37155
description: Add 'Histogram' types to the list of cloneable types.
- version: v15.6.0
Expand Down
Loading