diff options
author | Danielle Adams <adamzdanielle@gmail.com> | 2021-05-03 06:12:18 +0300 |
---|---|---|
committer | Danielle Adams <adamzdanielle@gmail.com> | 2021-05-12 02:05:18 +0300 |
commit | 16e00a15deafdad01c336bcae79f568f6bcb4c1b (patch) | |
tree | 7f06409a99dec341f9f5ca8acceb2d7161e4c3c2 /doc/api | |
parent | 4ebb88fea5a9d83f2c4ec566e958d735f1fca138 (diff) |
2021-05-11, Version 14.17.0 'Fermium' (LTS)
Notable Changes:
Diagnostics channel (experimental module):
`diagnostics_channel` is a new experimental module that provides an API
to create named channels to report arbitrary message data for
diagnostics purposes.
The module was initially introduced in Node.js v15.1.0 and is
backported to v14.17.0 to enable testing it at a larger scale.
With `diagnostics_channel`, Node.js core and module authors can publish
contextual data about what they are doing at a given time. This could
be the hostname and query string of a mysql query, for example. Just
create a named channel with `dc.channel(name)` and call
`channel.publish(data)` to send the data to any listeners to that
channel.
```js
const dc = require('diagnostics_channel');
const channel = dc.channel('mysql.query');
MySQL.prototype.query = function query(queryString, values, callback) {
// Broadcast query information whenever a query is made
channel.publish({
query: queryString,
host: this.hostname,
});
this.doQuery(queryString, values, callback);
};
```
Channels are like one big global event emitter but are split into
separate objects to ensure they get the best performance. If nothing is
listening to the channel, the publishing overhead should be as close to
zero as possible. Consuming channel data is as easy as using
`channel.subscribe(listener)` to run a function whenever a message is
published to that channel.
```js
const dc = require('diagnostics_channel');
const channel = dc.channel('mysql.query');
channel.subscribe(({ query, host }) => {
console.log(`mysql query to ${host}: ${query}`);
});
```
The data captured can be used to provide context for what an app is
doing at a given time. This can be used for things like augmenting
tracing data, tracking network and filesystem activity, logging
queries, and many other things. It's also a very useful data source
for diagnostics tools to provide a clearer picture of exactly what the
application is doing at a given point in the data they are presenting.
Contributed by Stephen Belanger (https://github.com/nodejs/node/pull/34895).
UUID support in the crypto module:
The new `crypto.randomUUID()` method now allows to generate random
[RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) Version 4
UUID strings:
```js
const { randomUUID } = require('crypto');
console.log(randomUUID());
// 'aa7c91a1-f8fc-4339-b9db-f93fc7233429'
```
Contributed by James M Snell (https://github.com/nodejs/node/pull/36729).
Experimental support for `AbortController` and `AbortSignal`:
Node.js 14.17.0 adds experimental partial support for `AbortController`
and `AbortSignal`.
Both constructors can be enabled globally using the
`--experimental-abortcontroller` flag.
Additionally, several Node.js APIs have been updated to support
`AbortSignal` for cancellation.
It is not mandatory to use the built-in constructors with them. Any
spec-compliant third-party alternatives should be compatible.
`AbortSignal` support was added to the following methods:
* `child_process.exec`
* `child_process.execFile`
* `child_process.fork`
* `child_process.spawn`
* `dgram.createSocket`
* `events.on`
* `events.once`
* `fs.readFile`
* `fs.watch`
* `fs.writeFile`
* `http.request`
* `https.request`
* `http2Session.request`
* The promisified variants of `setImmediate` and `setTimeout`
Other notable changes:
* doc:
* revoke deprecation of legacy url, change status to legacy (James M Snell) (https://github.com/nodejs/node/pull/37784)
* add legacy status to stability index (James M Snell) (https://github.com/nodejs/node/pull/37784)
* upgrade stability status of report API (Gireesh Punathil) (https://github.com/nodejs/node/pull/35654)
* deps:
* V8: Backport various patches for Apple Silicon support (BoHong Li) (https://github.com/nodejs/node/pull/38051)
* update ICU to 68.1 (Michaƫl Zasso) (https://github.com/nodejs/node/pull/36187)
* upgrade to libuv 1.41.0 (Colin Ihrig) (https://github.com/nodejs/node/pull/37360)
* http:
* add http.ClientRequest.getRawHeaderNames() (simov) (https://github.com/nodejs/node/pull/37660)
* report request start and end with diagnostics\_channel (Stephen Belanger) (https://github.com/nodejs/node/pull/34895)
* util:
* add getSystemErrorMap() impl (eladkeyshawn) (https://github.com/nodejs/node/pull/38101)
PR-URL: https://github.com/nodejs/node/pull/38507
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/buffer.md | 8 | ||||
-rw-r--r-- | doc/api/child_process.md | 16 | ||||
-rw-r--r-- | doc/api/cli.md | 4 | ||||
-rw-r--r-- | doc/api/crypto.md | 4 | ||||
-rw-r--r-- | doc/api/deprecations.md | 4 | ||||
-rw-r--r-- | doc/api/dns.md | 16 | ||||
-rw-r--r-- | doc/api/esm.md | 1 | ||||
-rw-r--r-- | doc/api/events.md | 1 | ||||
-rw-r--r-- | doc/api/fs.md | 33 | ||||
-rw-r--r-- | doc/api/globals.md | 32 | ||||
-rw-r--r-- | doc/api/http.md | 12 | ||||
-rw-r--r-- | doc/api/http2.md | 12 | ||||
-rw-r--r-- | doc/api/modules.md | 4 | ||||
-rw-r--r-- | doc/api/process.md | 1 | ||||
-rw-r--r-- | doc/api/readline.md | 4 | ||||
-rw-r--r-- | doc/api/stream.md | 4 | ||||
-rw-r--r-- | doc/api/url.md | 20 | ||||
-rw-r--r-- | doc/api/util.md | 4 | ||||
-rw-r--r-- | doc/api/worker_threads.md | 2 |
19 files changed, 141 insertions, 41 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 3c8dc975e42..6bd89920fe6 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -3283,7 +3283,9 @@ accessed using `require('buffer')`. ### `buffer.atob(data)` <!-- YAML -added: v15.13.0 +added: + - v15.13.0 + - v14.17.0 --> > Stability: 3 - Legacy. Use `Buffer.from(data, 'base64')` instead. @@ -3304,7 +3306,9 @@ and binary data should be performed using `Buffer.from(str, 'base64')` and ### `buffer.btoa(data)` <!-- YAML -added: v15.13.0 +added: + - v15.13.0 + - v14.17.0 --> > Stability: 3 - Legacy. Use `buf.toString('base64')` instead. diff --git a/doc/api/child_process.md b/doc/api/child_process.md index d9cfcde6d9e..2ac6f1c35c4 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -271,7 +271,9 @@ controller.abort(); <!-- YAML added: v0.1.91 changes: - - version: v15.4.0 + - version: + - v15.4.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/36308 description: AbortSignal support was added. - version: v8.8.0 @@ -380,7 +382,9 @@ changes: - version: v15.11.0 pr-url: https://github.com/nodejs/node/pull/37325 description: killSignal for AbortSignal was added. - - version: v15.6.0 + - version: + - v15.6.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/36603 description: AbortSignal support was added. - version: @@ -489,7 +493,9 @@ changes: - version: v15.11.0 pr-url: https://github.com/nodejs/node/pull/37325 description: killSignal for AbortSignal was added. - - version: v15.5.0 + - version: + - v15.5.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/36432 description: AbortSignal support was added. - version: @@ -1160,7 +1166,9 @@ See [Advanced serialization][] for more details. ### Event: `'spawn'` <!-- YAML -added: v15.1.0 +added: + - v15.1.0 + - v14.17.0 --> The `'spawn'` event is emitted once the child process has spawned successfully. diff --git a/doc/api/cli.md b/doc/api/cli.md index 0d78f9a31ce..c2e5f907957 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -210,7 +210,9 @@ modifying the stack trace. ### `--experimental-abortcontroller` <!-- YAML -added: v15.0.0 +added: + - v15.0.0 + - v14.17.0 changes: - version: v15.0.0 pr-url: https://github.com/nodejs/node/pull/33527 diff --git a/doc/api/crypto.md b/doc/api/crypto.md index d0a3bb41b0e..e9a2be8f26e 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -4707,7 +4707,9 @@ console.log(`The dice rolled: ${n}`); ### `crypto.randomUUID([options])` <!-- YAML -added: v15.6.0 +added: + - v15.6.0 + - v14.17.0 --> * `options` {Object} diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index a0140b16e9b..6ded89adeb2 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2176,7 +2176,9 @@ future release. ### DEP0116: Legacy URL API <!-- YAML changes: - - version: v15.13.0 + - version: + - v15.13.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/37784 description: Deprecation revoked. Status changed to "Legacy". - version: v11.0.0 diff --git a/doc/api/dns.md b/doc/api/dns.md index cdb948309f1..a5a4432e2d9 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -119,7 +119,9 @@ callbacks will be called with an error with code `ECANCELLED`. ### `resolver.setLocalAddress([ipv4][, ipv6])` <!-- YAML -added: v15.1.0 +added: + - v15.1.0 + - v14.17.0 --> * `ipv4` {string} A string representation of an IPv4 address. @@ -439,7 +441,9 @@ will contain an array of canonical name records available for the `hostname` ## `dns.resolveCaa(hostname, callback)` <!-- YAML -added: v15.0.0 +added: + - v15.0.0 + - v14.17.0 --> * `hostname` {string} @@ -732,7 +736,9 @@ The following methods from the `dnsPromises` API are available: ### `resolver.cancel()` <!-- YAML -added: v15.3.0 +added: + - v15.3.0 + - v14.17.0 --> Cancel all outstanding DNS queries made by this resolver. The corresponding @@ -960,7 +966,9 @@ Here is an example of the result object: ### `dnsPromises.resolveCaa(hostname)` <!-- YAML -added: v15.0.0 +added: + - v15.0.0 + - v14.17.0 --> * `hostname` {string} diff --git a/doc/api/esm.md b/doc/api/esm.md index f9787129db4..32168c29dd0 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -7,6 +7,7 @@ added: v8.5.0 changes: - version: - v15.3.0 + - v14.17.0 - v12.22.0 pr-url: https://github.com/nodejs/node/pull/35781 description: Stabilize modules implementation. diff --git a/doc/api/events.md b/doc/api/events.md index ca2ae7e6c84..540b663bd56 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -814,6 +814,7 @@ regular `'error'` listener is installed. <!-- YAML added: - v15.2.0 + - v14.17.0 --> * `emitterOrTarget` {EventEmitter|EventTarget} * `eventName` {string|symbol} diff --git a/doc/api/fs.md b/doc/api/fs.md index ae1db3899f4..4f88ce44027 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1721,7 +1721,9 @@ See the POSIX chown(2) documentation for more detail. <!-- YAML added: v0.0.2 changes: - - version: v15.9.0 + - version: + - v15.9.0 + - v14.17.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 @@ -2836,7 +2838,9 @@ changes: pr-url: https://github.com/nodejs/node/pull/37460 description: The error returned may be an `AggregateError` if more than one error is returned. - - version: v15.2.0 + - version: + - v15.2.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/35911 description: The options argument may include an AbortSignal to abort an ongoing readFile request. @@ -3554,7 +3558,9 @@ The `atime` and `mtime` arguments follow these rules: <!-- YAML added: v0.5.10 changes: - - version: v15.9.0 + - version: + - v15.9.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/37190 description: Added support for closing the watcher with an AbortSignal. - version: v7.6.0 @@ -3883,7 +3889,9 @@ changes: pr-url: https://github.com/nodejs/node/pull/37460 description: The error returned may be an `AggregateError` if more than one error is returned. - - version: v15.2.0 + - version: + - v15.2.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/35993 description: The options argument may include an AbortSignal to abort an ongoing writeFile request. @@ -5924,7 +5932,22 @@ Emitted when the {fs.WriteStream}'s underlying file descriptor has been closed. #### Event: `'open'` <!-- YAML -added: v0.1.93 +added: + - v10.0.0 + - v0.1.93 +changes: + - version: v14.17.0 + pr-url: https://github.com/nodejs/node/pull/35993 + description: The options argument may include an AbortSignal to abort an + ongoing writeFile request. + - version: v14.12.0 + pr-url: https://github.com/nodejs/node/pull/34993 + description: The `data` parameter will stringify an object with an + explicit `toString` function. + - version: v14.0.0 + pr-url: https://github.com/nodejs/node/pull/31030 + description: The `data` parameter won't coerce unsupported input to + strings anymore. --> * `fd` {integer} Integer file descriptor used by the {fs.WriteStream}. diff --git a/doc/api/globals.md b/doc/api/globals.md index ea764a20fb3..8ce4ff1942b 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -19,7 +19,9 @@ accessible. ## Class: `AbortController` <!-- YAML -added: v15.0.0 +added: + - v15.0.0 + - v14.17.0 changes: - version: v15.4.0 pr-url: https://github.com/nodejs/node/pull/35949 @@ -44,7 +46,9 @@ console.log(ac.signal.aborted); // Prints True ### `abortController.abort()` <!-- YAML -added: v15.0.0 +added: + - v15.0.0 + - v14.17.0 --> Triggers the abort signal, causing the `abortController.signal` to emit @@ -52,14 +56,18 @@ the `'abort'` event. ### `abortController.signal` <!-- YAML -added: v15.0.0 +added: + - v15.0.0 + - v14.17.0 --> * Type: {AbortSignal} ### Class: `AbortSignal` <!-- YAML -added: v15.0.0 +added: + - v15.0.0 + - v14.17.0 --> * Extends: {EventTarget} @@ -69,7 +77,9 @@ The `AbortSignal` is used to notify observers when the #### Static method: `AbortSignal.abort()` <!-- YAML -added: v15.12.0 +added: + - v15.12.0 + - v14.17.0 --> * Returns: {AbortSignal} @@ -78,7 +88,9 @@ Returns a new already aborted `AbortSignal`. #### Event: `'abort'` <!-- YAML -added: v15.0.0 +added: + - v15.0.0 + - v14.17.0 --> The `'abort'` event is emitted when the `abortController.abort()` method @@ -112,14 +124,18 @@ result in memory leaks. #### `abortSignal.aborted` <!-- YAML -added: v15.0.0 +added: + - v15.0.0 + - v14.17.0 --> * Type: {boolean} True after the `AbortController` has been aborted. #### `abortSignal.onabort` <!-- YAML -added: v15.0.0 +added: + - v15.0.0 + - v14.17.0 --> * Type: {Function} diff --git a/doc/api/http.md b/doc/api/http.md index e93e2a5d1ba..5ec542e9011 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -113,7 +113,9 @@ http.get({ <!-- YAML added: v0.3.4 changes: - - version: v15.6.0 + - version: + - v15.6.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/36685 description: Change the default scheduling from 'fifo' to 'lifo'. - version: @@ -779,7 +781,9 @@ const cookie = request.getHeader('Cookie'); ### `request.getRawHeaderNames()` <!-- YAML -added: v15.13.0 +added: + - v15.13.0 + - v14.17.0 --> * Returns: {string[]} @@ -2797,7 +2801,9 @@ This can be overridden for servers and client requests by passing the <!-- YAML added: v0.3.6 changes: - - version: v15.3.0 + - version: + - v15.3.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/36048 description: It is possible to abort a request with an AbortSignal. - version: diff --git a/doc/api/http2.md b/doc/api/http2.md index 7956e8e82d2..83b80150ade 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -2,7 +2,9 @@ <!-- YAML added: v8.4.0 changes: - - version: v15.3.0 + - version: + - v15.3.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/36070 description: It is possible to abort a request with an AbortSignal. - version: v15.0.0 @@ -1928,7 +1930,9 @@ value only affects new connections to the server, not any existing connections. #### `server.updateSettings([settings])` <!-- YAML -added: v15.1.0 +added: + - v15.1.0 + - v14.17.0 --> * `settings` {HTTP/2 Settings Object} @@ -2130,7 +2134,9 @@ value only affects new connections to the server, not any existing connections. #### `server.updateSettings([settings])` <!-- YAML -added: v15.1.0 +added: + - v15.1.0 + - v14.17.0 --> * `settings` {HTTP/2 Settings Object} diff --git a/doc/api/modules.md b/doc/api/modules.md index a28be94e536..9bb3bf0c56b 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -913,7 +913,9 @@ filename. ### `module.isPreloading` <!-- YAML -added: v15.4.0 +added: + - v15.4.0 + - v14.17.0 --> * Type: {boolean} `true` if the module is running during the Node.js preload diff --git a/doc/api/process.md b/doc/api/process.md index 95dd6a87855..1eff6a5b261 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -2030,6 +2030,7 @@ added: v11.12.0 changes: - version: - v15.0.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/35654 description: This API is no longer experimental. --> diff --git a/doc/api/readline.md b/doc/api/readline.md index 58c7209b761..d67beab5d05 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -346,7 +346,9 @@ whenever `rl.prompt()` is called. ### `rl.getPrompt()` <!-- YAML -added: v15.3.0 +added: + - v15.3.0 + - v14.17.0 --> * Returns: {string} the current prompt string diff --git a/doc/api/stream.md b/doc/api/stream.md index 4e35340c048..cc18b643b71 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -586,7 +586,9 @@ the status of the `highWaterMark`. ##### `writable.writableNeedDrain` <!-- YAML -added: v15.2.0 +added: + - v15.2.0 + - v14.17.0 --> * {boolean} diff --git a/doc/api/url.md b/doc/api/url.md index ce528f5f6c8..2330755a6f1 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -1101,7 +1101,9 @@ console.log(urlToHttpOptions(myUrl)); ## Legacy URL API <!-- YAML changes: - - version: v15.13.0 + - version: + - v15.13.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/37784 description: Deprecation revoked. Status changed to "Legacy". - version: v11.0.0 @@ -1114,7 +1116,9 @@ changes: ### Legacy `urlObject` <!-- YAML changes: - - version: v15.13.0 + - version: + - v15.13.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/37784 description: Deprecation revoked. Status changed to "Legacy". - version: v11.0.0 @@ -1228,7 +1232,9 @@ forward-slash characters (`/`) are required following the colon in the <!-- YAML added: v0.1.25 changes: - - version: v15.13.0 + - version: + - v15.13.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/37784 description: Deprecation revoked. Status changed to "Legacy". - version: v11.0.0 @@ -1324,7 +1330,9 @@ The formatting process operates as follows: <!-- YAML added: v0.1.25 changes: - - version: v15.13.0 + - version: + - v15.13.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/37784 description: Deprecation revoked. Status changed to "Legacy". - version: v11.14.0 @@ -1371,7 +1379,9 @@ incorrect handling of usernames and passwords have been identified. <!-- YAML added: v0.1.25 changes: - - version: v15.13.0 + - version: + - v15.13.0 + - v14.17.0 pr-url: https://github.com/nodejs/node/pull/37784 description: Deprecation revoked. Status changed to "Legacy". - version: v11.0.0 diff --git a/doc/api/util.md b/doc/api/util.md index 4f3ff2e7358..429005799bd 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -378,7 +378,9 @@ fs.access('file/that/does/not/exist', (err) => { ## `util.getSystemErrorMap()` <!-- YAML -added: v16.0.0 +added: + - v16.0.0 + - v14.17.0 --> * Returns: {Map} diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 5d0781751ca..26e1cf99545 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -1016,6 +1016,7 @@ immediately with an [`ERR_WORKER_NOT_RUNNING`][] error. <!-- YAML added: - v15.1.0 + - v14.17.0 - v12.22.0 --> @@ -1026,6 +1027,7 @@ instance. Similar to [`perf_hooks.performance`][]. <!-- YAML added: - v15.1.0 + - v14.17.0 - v12.22.0 --> |