Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanielle Adams <adamzdanielle@gmail.com>2021-05-03 06:12:18 +0300
committerDanielle Adams <adamzdanielle@gmail.com>2021-05-12 02:05:18 +0300
commit16e00a15deafdad01c336bcae79f568f6bcb4c1b (patch)
tree7f06409a99dec341f9f5ca8acceb2d7161e4c3c2 /doc/api/dns.md
parent4ebb88fea5a9d83f2c4ec566e958d735f1fca138 (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/dns.md')
-rw-r--r--doc/api/dns.md16
1 files changed, 12 insertions, 4 deletions
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}