doc: declare all parameter types

PR-URL: https://github.com/nodejs/node/pull/21782
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
This commit is contained in:
Sam Ruby 2018-07-12 13:48:11 -04:00 committed by Vse Mozhet Byt
parent 1009118d27
commit 40c85ff063
15 changed files with 427 additions and 290 deletions

View File

@ -503,6 +503,7 @@ console.profileEnd('MyLabel');
<!-- YAML <!-- YAML
added: v8.0.0 added: v8.0.0
--> -->
* `label` {string}
This method does not display anything unless used in the inspector. Stops the This method does not display anything unless used in the inspector. Stops the
current JavaScript CPU profiling session if one has been started and prints current JavaScript CPU profiling session if one has been started and prints

View File

@ -55,8 +55,8 @@ data. The most common usage is handling output generated by the HTML5
<!-- YAML <!-- YAML
added: v9.0.0 added: v9.0.0
--> -->
- `spkac` {string | Buffer | TypedArray | DataView} * `spkac` {string | Buffer | TypedArray | DataView}
- Returns: {Buffer} The challenge component of the `spkac` data structure, which * Returns: {Buffer} The challenge component of the `spkac` data structure, which
includes a public key and a challenge. includes a public key and a challenge.
```js ```js
@ -71,9 +71,9 @@ console.log(challenge.toString('utf8'));
<!-- YAML <!-- YAML
added: v9.0.0 added: v9.0.0
--> -->
- `spkac` {string | Buffer | TypedArray | DataView} * `spkac` {string | Buffer | TypedArray | DataView}
- `encoding` {string} * `encoding` {string}
- Returns: {Buffer} The public key component of the `spkac` data structure, * Returns: {Buffer} The public key component of the `spkac` data structure,
which includes a public key and a challenge. which includes a public key and a challenge.
```js ```js
@ -88,8 +88,8 @@ console.log(publicKey);
<!-- YAML <!-- YAML
added: v9.0.0 added: v9.0.0
--> -->
- `spkac` {Buffer | TypedArray | DataView} * `spkac` {Buffer | TypedArray | DataView}
- Returns: {boolean} `true` if the given `spkac` data structure is valid, * Returns: {boolean} `true` if the given `spkac` data structure is valid,
`false` otherwise. `false` otherwise.
```js ```js
@ -121,8 +121,8 @@ const cert2 = crypto.Certificate();
<!-- YAML <!-- YAML
added: v0.11.8 added: v0.11.8
--> -->
- `spkac` {string | Buffer | TypedArray | DataView} * `spkac` {string | Buffer | TypedArray | DataView}
- Returns: {Buffer} The challenge component of the `spkac` data structure, which * Returns: {Buffer} The challenge component of the `spkac` data structure, which
includes a public key and a challenge. includes a public key and a challenge.
```js ```js
@ -137,8 +137,8 @@ console.log(challenge.toString('utf8'));
<!-- YAML <!-- YAML
added: v0.11.8 added: v0.11.8
--> -->
- `spkac` {string | Buffer | TypedArray | DataView} * `spkac` {string | Buffer | TypedArray | DataView}
- Returns: {Buffer} The public key component of the `spkac` data structure, * Returns: {Buffer} The public key component of the `spkac` data structure,
which includes a public key and a challenge. which includes a public key and a challenge.
```js ```js
@ -153,8 +153,8 @@ console.log(publicKey);
<!-- YAML <!-- YAML
added: v0.11.8 added: v0.11.8
--> -->
- `spkac` {Buffer | TypedArray | DataView} * `spkac` {Buffer | TypedArray | DataView}
- Returns: {boolean} `true` if the given `spkac` data structure is valid, * Returns: {boolean} `true` if the given `spkac` data structure is valid,
`false` otherwise. `false` otherwise.
```js ```js
@ -231,8 +231,8 @@ console.log(encrypted);
<!-- YAML <!-- YAML
added: v0.1.94 added: v0.1.94
--> -->
- `outputEncoding` {string} * `outputEncoding` {string}
- Returns: {Buffer | string} Any remaining enciphered contents. * Returns: {Buffer | string} Any remaining enciphered contents.
If `outputEncoding` is one of `'latin1'`, `'base64'` or `'hex'`, a string is If `outputEncoding` is one of `'latin1'`, `'base64'` or `'hex'`, a string is
returned. If an `outputEncoding` is not provided, a [`Buffer`][] is returned. returned. If an `outputEncoding` is not provided, a [`Buffer`][] is returned.
@ -244,10 +244,10 @@ once will result in an error being thrown.
<!-- YAML <!-- YAML
added: v1.0.0 added: v1.0.0
--> -->
- `buffer` {Buffer} * `buffer` {Buffer}
- `options` {Object} [`stream.transform` options][] * `options` {Object} [`stream.transform` options][]
- `plaintextLength` {number} - `plaintextLength` {number}
- Returns: {Cipher} for method chaining. * Returns: {Cipher} for method chaining.
When using an authenticated encryption mode (only `GCM` and `CCM` are currently When using an authenticated encryption mode (only `GCM` and `CCM` are currently
supported), the `cipher.setAAD()` method sets the value used for the supported), the `cipher.setAAD()` method sets the value used for the
@ -263,7 +263,7 @@ The `cipher.setAAD()` method must be called before [`cipher.update()`][].
<!-- YAML <!-- YAML
added: v1.0.0 added: v1.0.0
--> -->
- Returns: {Buffer} When using an authenticated encryption mode (only `GCM` and * Returns: {Buffer} When using an authenticated encryption mode (only `GCM` and
`CCM` are currently supported), the `cipher.getAuthTag()` method returns a `CCM` are currently supported), the `cipher.getAuthTag()` method returns a
[`Buffer`][] containing the _authentication tag_ that has been computed from [`Buffer`][] containing the _authentication tag_ that has been computed from
the given data. the given data.
@ -275,8 +275,8 @@ been completed using the [`cipher.final()`][] method.
<!-- YAML <!-- YAML
added: v0.7.1 added: v0.7.1
--> -->
- `autoPadding` {boolean} **Default:** `true` * `autoPadding` {boolean} **Default:** `true`
- Returns: {Cipher} for method chaining. * Returns: {Cipher} for method chaining.
When using block encryption algorithms, the `Cipher` class will automatically When using block encryption algorithms, the `Cipher` class will automatically
add padding to the input data to the appropriate block size. To disable the add padding to the input data to the appropriate block size. To disable the
@ -298,10 +298,10 @@ changes:
pr-url: https://github.com/nodejs/node/pull/5522 pr-url: https://github.com/nodejs/node/pull/5522
description: The default `inputEncoding` changed from `binary` to `utf8`. description: The default `inputEncoding` changed from `binary` to `utf8`.
--> -->
- `data` {string | Buffer | TypedArray | DataView} * `data` {string | Buffer | TypedArray | DataView}
- `inputEncoding` {string} * `inputEncoding` {string}
- `outputEncoding` {string} * `outputEncoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Updates the cipher with `data`. If the `inputEncoding` argument is given, Updates the cipher with `data`. If the `inputEncoding` argument is given,
its value must be one of `'utf8'`, `'ascii'`, or `'latin1'` and the `data` its value must be one of `'utf8'`, `'ascii'`, or `'latin1'` and the `data`
@ -390,8 +390,8 @@ console.log(decrypted);
<!-- YAML <!-- YAML
added: v0.1.94 added: v0.1.94
--> -->
- `outputEncoding` {string} * `outputEncoding` {string}
- Returns: {Buffer | string} Any remaining deciphered contents. * Returns: {Buffer | string} Any remaining deciphered contents.
If `outputEncoding` is one of `'latin1'`, `'ascii'` or `'utf8'`, a string is If `outputEncoding` is one of `'latin1'`, `'ascii'` or `'utf8'`, a string is
returned. If an `outputEncoding` is not provided, a [`Buffer`][] is returned. returned. If an `outputEncoding` is not provided, a [`Buffer`][] is returned.
@ -407,10 +407,10 @@ changes:
pr-url: https://github.com/nodejs/node/pull/9398 pr-url: https://github.com/nodejs/node/pull/9398
description: This method now returns a reference to `decipher`. description: This method now returns a reference to `decipher`.
--> -->
- `buffer` {Buffer | TypedArray | DataView} * `buffer` {Buffer | TypedArray | DataView}
- `options` {Object} [`stream.transform` options][] * `options` {Object} [`stream.transform` options][]
- `plaintextLength` {number} - `plaintextLength` {number}
- Returns: {Decipher} for method chaining. * Returns: {Decipher} for method chaining.
When using an authenticated encryption mode (only `GCM` and `CCM` are currently When using an authenticated encryption mode (only `GCM` and `CCM` are currently
supported), the `decipher.setAAD()` method sets the value used for the supported), the `decipher.setAAD()` method sets the value used for the
@ -433,8 +433,8 @@ changes:
pr-url: https://github.com/nodejs/node/pull/9398 pr-url: https://github.com/nodejs/node/pull/9398
description: This method now returns a reference to `decipher`. description: This method now returns a reference to `decipher`.
--> -->
- `buffer` {Buffer | TypedArray | DataView} * `buffer` {Buffer | TypedArray | DataView}
- Returns: {Decipher} for method chaining. * Returns: {Decipher} for method chaining.
When using an authenticated encryption mode (only `GCM` and `CCM` are currently When using an authenticated encryption mode (only `GCM` and `CCM` are currently
supported), the `decipher.setAuthTag()` method is used to pass in the supported), the `decipher.setAuthTag()` method is used to pass in the
@ -451,8 +451,8 @@ The `decipher.setAuthTag()` method must be called before
<!-- YAML <!-- YAML
added: v0.7.1 added: v0.7.1
--> -->
- `autoPadding` {boolean} **Default:** `true` * `autoPadding` {boolean} **Default:** `true`
- Returns: {Decipher} for method chaining. * Returns: {Decipher} for method chaining.
When data has been encrypted without standard block padding, calling When data has been encrypted without standard block padding, calling
`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.setAutoPadding(false)` will disable automatic padding to prevent
@ -472,10 +472,10 @@ changes:
pr-url: https://github.com/nodejs/node/pull/5522 pr-url: https://github.com/nodejs/node/pull/5522
description: The default `inputEncoding` changed from `binary` to `utf8`. description: The default `inputEncoding` changed from `binary` to `utf8`.
--> -->
- `data` {string | Buffer | TypedArray | DataView} * `data` {string | Buffer | TypedArray | DataView}
- `inputEncoding` {string} * `inputEncoding` {string}
- `outputEncoding` {string} * `outputEncoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Updates the decipher with `data`. If the `inputEncoding` argument is given, Updates the decipher with `data`. If the `inputEncoding` argument is given,
its value must be one of `'latin1'`, `'base64'`, or `'hex'` and the `data` its value must be one of `'latin1'`, `'base64'`, or `'hex'` and the `data`
@ -527,10 +527,10 @@ assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
<!-- YAML <!-- YAML
added: v0.5.0 added: v0.5.0
--> -->
- `otherPublicKey` {string | Buffer | TypedArray | DataView} * `otherPublicKey` {string | Buffer | TypedArray | DataView}
- `inputEncoding` {string} * `inputEncoding` {string}
- `outputEncoding` {string} * `outputEncoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Computes the shared secret using `otherPublicKey` as the other Computes the shared secret using `otherPublicKey` as the other
party's public key and returns the computed shared secret. The supplied party's public key and returns the computed shared secret. The supplied
@ -547,8 +547,8 @@ If `outputEncoding` is given a string is returned; otherwise, a
<!-- YAML <!-- YAML
added: v0.5.0 added: v0.5.0
--> -->
- `encoding` {string} * `encoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Generates private and public Diffie-Hellman key values, and returns Generates private and public Diffie-Hellman key values, and returns
the public key in the specified `encoding`. This key should be the public key in the specified `encoding`. This key should be
@ -560,8 +560,8 @@ or `'base64'`. If `encoding` is provided a string is returned; otherwise a
<!-- YAML <!-- YAML
added: v0.5.0 added: v0.5.0
--> -->
- `encoding` {string} * `encoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Returns the Diffie-Hellman generator in the specified `encoding`, which can Returns the Diffie-Hellman generator in the specified `encoding`, which can
be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is
@ -571,8 +571,8 @@ returned; otherwise a [`Buffer`][] is returned.
<!-- YAML <!-- YAML
added: v0.5.0 added: v0.5.0
--> -->
- `encoding` {string} * `encoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Returns the Diffie-Hellman prime in the specified `encoding`, which can Returns the Diffie-Hellman prime in the specified `encoding`, which can
be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a string is
@ -582,8 +582,8 @@ returned; otherwise a [`Buffer`][] is returned.
<!-- YAML <!-- YAML
added: v0.5.0 added: v0.5.0
--> -->
- `encoding` {string} * `encoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Returns the Diffie-Hellman private key in the specified `encoding`, Returns the Diffie-Hellman private key in the specified `encoding`,
which can be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a which can be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a
@ -593,8 +593,8 @@ string is returned; otherwise a [`Buffer`][] is returned.
<!-- YAML <!-- YAML
added: v0.5.0 added: v0.5.0
--> -->
- `encoding` {string} * `encoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Returns the Diffie-Hellman public key in the specified `encoding`, which Returns the Diffie-Hellman public key in the specified `encoding`, which
can be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a can be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` is provided a
@ -604,8 +604,8 @@ string is returned; otherwise a [`Buffer`][] is returned.
<!-- YAML <!-- YAML
added: v0.5.0 added: v0.5.0
--> -->
- `privateKey` {string | Buffer | TypedArray | DataView} * `privateKey` {string | Buffer | TypedArray | DataView}
- `encoding` {string} * `encoding` {string}
Sets the Diffie-Hellman private key. If the `encoding` argument is provided Sets the Diffie-Hellman private key. If the `encoding` argument is provided
and is either `'latin1'`, `'hex'`, or `'base64'`, `privateKey` is expected and is either `'latin1'`, `'hex'`, or `'base64'`, `privateKey` is expected
@ -616,8 +616,8 @@ to be a [`Buffer`][], `TypedArray`, or `DataView`.
<!-- YAML <!-- YAML
added: v0.5.0 added: v0.5.0
--> -->
- `publicKey` {string | Buffer | TypedArray | DataView} * `publicKey` {string | Buffer | TypedArray | DataView}
- `encoding` {string} * `encoding` {string}
Sets the Diffie-Hellman public key. If the `encoding` argument is provided Sets the Diffie-Hellman public key. If the `encoding` argument is provided
and is either `'latin1'`, `'hex'` or `'base64'`, `publicKey` is expected and is either `'latin1'`, `'hex'` or `'base64'`, `publicKey` is expected
@ -676,12 +676,12 @@ assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
added: v10.0.0 added: v10.0.0
--> -->
- `key` {string | Buffer | TypedArray | DataView} * `key` {string | Buffer | TypedArray | DataView}
- `curve` {string} * `curve` {string}
- `inputEncoding` {string} * `inputEncoding` {string}
- `outputEncoding` {string} * `outputEncoding` {string}
- `format` {string} **Default:** `'uncompressed'` * `format` {string} **Default:** `'uncompressed'`
- Returns: {Buffer | string} * Returns: {Buffer | string}
Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the
format specified by `format`. The `format` argument specifies point encoding format specified by `format`. The `format` argument specifies point encoding
@ -732,10 +732,10 @@ changes:
description: Changed error format to better support invalid public key description: Changed error format to better support invalid public key
error error
--> -->
- `otherPublicKey` {string | Buffer | TypedArray | DataView} * `otherPublicKey` {string | Buffer | TypedArray | DataView}
- `inputEncoding` {string} * `inputEncoding` {string}
- `outputEncoding` {string} * `outputEncoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Computes the shared secret using `otherPublicKey` as the other Computes the shared secret using `otherPublicKey` as the other
party's public key and returns the computed shared secret. The supplied party's public key and returns the computed shared secret. The supplied
@ -758,9 +758,9 @@ its recommended for developers to handle this exception accordingly.
<!-- YAML <!-- YAML
added: v0.11.14 added: v0.11.14
--> -->
- `encoding` {string} * `encoding` {string}
- `format` {string} **Default:** `'uncompressed'` * `format` {string} **Default:** `'uncompressed'`
- Returns: {Buffer | string} * Returns: {Buffer | string}
Generates private and public EC Diffie-Hellman key values, and returns Generates private and public EC Diffie-Hellman key values, and returns
the public key in the specified `format` and `encoding`. This key should be the public key in the specified `format` and `encoding`. This key should be
@ -778,8 +778,8 @@ is returned.
<!-- YAML <!-- YAML
added: v0.11.14 added: v0.11.14
--> -->
- `encoding` {string} * `encoding` {string}
- Returns: {Buffer | string} The EC Diffie-Hellman private key in the specified * Returns: {Buffer | string} The EC Diffie-Hellman private key in the specified
`encoding`, which can be `'latin1'`, `'hex'`, or `'base64'`. If `encoding` `encoding`, which can be `'latin1'`, `'hex'`, or `'base64'`. If `encoding`
is provided a string is returned; otherwise a [`Buffer`][] is returned. is provided a string is returned; otherwise a [`Buffer`][] is returned.
@ -787,9 +787,9 @@ added: v0.11.14
<!-- YAML <!-- YAML
added: v0.11.14 added: v0.11.14
--> -->
- `encoding` {string} * `encoding` {string}
- `format` {string} **Default:** `'uncompressed'` * `format` {string} **Default:** `'uncompressed'`
- Returns: {Buffer | string} The EC Diffie-Hellman public key in the specified * Returns: {Buffer | string} The EC Diffie-Hellman public key in the specified
`encoding` and `format`. `encoding` and `format`.
The `format` argument specifies point encoding and can be `'compressed'` or The `format` argument specifies point encoding and can be `'compressed'` or
@ -804,8 +804,8 @@ returned.
<!-- YAML <!-- YAML
added: v0.11.14 added: v0.11.14
--> -->
- `privateKey` {string | Buffer | TypedArray | DataView} * `privateKey` {string | Buffer | TypedArray | DataView}
- `encoding` {string} * `encoding` {string}
Sets the EC Diffie-Hellman private key. The `encoding` can be `'latin1'`, Sets the EC Diffie-Hellman private key. The `encoding` can be `'latin1'`,
`'hex'` or `'base64'`. If `encoding` is provided, `privateKey` is expected `'hex'` or `'base64'`. If `encoding` is provided, `privateKey` is expected
@ -824,8 +824,8 @@ deprecated: v5.2.0
> Stability: 0 - Deprecated > Stability: 0 - Deprecated
- `publicKey` {string | Buffer | TypedArray | DataView} * `publicKey` {string | Buffer | TypedArray | DataView}
- `encoding` {string} * `encoding` {string}
Sets the EC Diffie-Hellman public key. Key encoding can be `'latin1'`, Sets the EC Diffie-Hellman public key. Key encoding can be `'latin1'`,
`'hex'` or `'base64'`. If `encoding` is provided `publicKey` is expected to `'hex'` or `'base64'`. If `encoding` is provided `publicKey` is expected to
@ -925,8 +925,8 @@ console.log(hash.digest('hex'));
<!-- YAML <!-- YAML
added: v0.1.92 added: v0.1.92
--> -->
- `encoding` {string} * `encoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Calculates the digest of all of the data passed to be hashed (using the Calculates the digest of all of the data passed to be hashed (using the
[`hash.update()`][] method). The `encoding` can be `'hex'`, `'latin1'` or [`hash.update()`][] method). The `encoding` can be `'hex'`, `'latin1'` or
@ -944,8 +944,8 @@ changes:
pr-url: https://github.com/nodejs/node/pull/5522 pr-url: https://github.com/nodejs/node/pull/5522
description: The default `inputEncoding` changed from `binary` to `utf8`. description: The default `inputEncoding` changed from `binary` to `utf8`.
--> -->
- `data` {string | Buffer | TypedArray | DataView} * `data` {string | Buffer | TypedArray | DataView}
- `inputEncoding` {string} * `inputEncoding` {string}
Updates the hash content with the given `data`, the encoding of which Updates the hash content with the given `data`, the encoding of which
is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or
@ -1017,8 +1017,8 @@ console.log(hmac.digest('hex'));
<!-- YAML <!-- YAML
added: v0.1.94 added: v0.1.94
--> -->
- `encoding` {string} * `encoding` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Calculates the HMAC digest of all of the data passed using [`hmac.update()`][]. Calculates the HMAC digest of all of the data passed using [`hmac.update()`][].
The `encoding` can be `'hex'`, `'latin1'` or `'base64'`. If `encoding` is The `encoding` can be `'hex'`, `'latin1'` or `'base64'`. If `encoding` is
@ -1035,8 +1035,8 @@ changes:
pr-url: https://github.com/nodejs/node/pull/5522 pr-url: https://github.com/nodejs/node/pull/5522
description: The default `inputEncoding` changed from `binary` to `utf8`. description: The default `inputEncoding` changed from `binary` to `utf8`.
--> -->
- `data` {string | Buffer | TypedArray | DataView} * `data` {string | Buffer | TypedArray | DataView}
- `inputEncoding` {string} * `inputEncoding` {string}
Updates the `Hmac` content with the given `data`, the encoding of which Updates the `Hmac` content with the given `data`, the encoding of which
is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or
@ -1118,11 +1118,11 @@ changes:
pr-url: https://github.com/nodejs/node/pull/11705 pr-url: https://github.com/nodejs/node/pull/11705
description: Support for RSASSA-PSS and additional options was added. description: Support for RSASSA-PSS and additional options was added.
--> -->
- `privateKey` {string | Object} * `privateKey` {string | Object}
- `key` {string} - `key` {string}
- `passphrase` {string} - `passphrase` {string}
- `outputFormat` {string} * `outputFormat` {string}
- Returns: {Buffer | string} * Returns: {Buffer | string}
Calculates the signature on all the data passed through using either Calculates the signature on all the data passed through using either
[`sign.update()`][] or [`sign.write()`][stream-writable-write]. [`sign.update()`][] or [`sign.write()`][stream-writable-write].
@ -1160,8 +1160,8 @@ changes:
pr-url: https://github.com/nodejs/node/pull/5522 pr-url: https://github.com/nodejs/node/pull/5522
description: The default `inputEncoding` changed from `binary` to `utf8`. description: The default `inputEncoding` changed from `binary` to `utf8`.
--> -->
- `data` {string | Buffer | TypedArray | DataView} * `data` {string | Buffer | TypedArray | DataView}
- `inputEncoding` {string} * `inputEncoding` {string}
Updates the `Sign` content with the given `data`, the encoding of which Updates the `Sign` content with the given `data`, the encoding of which
is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or
@ -1224,8 +1224,8 @@ changes:
pr-url: https://github.com/nodejs/node/pull/5522 pr-url: https://github.com/nodejs/node/pull/5522
description: The default `inputEncoding` changed from `binary` to `utf8`. description: The default `inputEncoding` changed from `binary` to `utf8`.
--> -->
- `data` {string | Buffer | TypedArray | DataView} * `data` {string | Buffer | TypedArray | DataView}
- `inputEncoding` {string} * `inputEncoding` {string}
Updates the `Verify` content with the given `data`, the encoding of which Updates the `Verify` content with the given `data`, the encoding of which
is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or is given in `inputEncoding` and can be `'utf8'`, `'ascii'` or
@ -1243,10 +1243,10 @@ changes:
pr-url: https://github.com/nodejs/node/pull/11705 pr-url: https://github.com/nodejs/node/pull/11705
description: Support for RSASSA-PSS and additional options was added. description: Support for RSASSA-PSS and additional options was added.
--> -->
- `object` {string | Object} * `object` {string | Object}
- `signature` {string | Buffer | TypedArray | DataView} * `signature` {string | Buffer | TypedArray | DataView}
- `signatureFormat` {string} * `signatureFormat` {string}
- Returns: {boolean} `true` or `false` depending on the validity of the * Returns: {boolean} `true` or `false` depending on the validity of the
signature for the data and public key. signature for the data and public key.
Verifies the provided data using the given `object` and `signature`. Verifies the provided data using the given `object` and `signature`.
@ -1283,7 +1283,7 @@ thrown.
<!-- YAML <!-- YAML
added: v6.3.0 added: v6.3.0
--> -->
- Returns: {Object} An object containing commonly used constants for crypto and * Returns: {Object} An object containing commonly used constants for crypto and
security related operations. The specific constants currently defined are security related operations. The specific constants currently defined are
described in [Crypto Constants][]. described in [Crypto Constants][].
@ -1329,10 +1329,10 @@ changes:
> Stability: 0 - Deprecated: Use [`crypto.createCipheriv()`][] instead. > Stability: 0 - Deprecated: Use [`crypto.createCipheriv()`][] instead.
- `algorithm` {string} * `algorithm` {string}
- `password` {string | Buffer | TypedArray | DataView} * `password` {string | Buffer | TypedArray | DataView}
- `options` {Object} [`stream.transform` options][] * `options` {Object} [`stream.transform` options][]
- Returns: {Cipher} * Returns: {Cipher}
Creates and returns a `Cipher` object that uses the given `algorithm` and Creates and returns a `Cipher` object that uses the given `algorithm` and
`password`. `password`.
@ -1382,11 +1382,11 @@ changes:
description: The `iv` parameter may now be `null` for ciphers which do not description: The `iv` parameter may now be `null` for ciphers which do not
need an initialization vector. need an initialization vector.
--> -->
- `algorithm` {string} * `algorithm` {string}
- `key` {string | Buffer | TypedArray | DataView} * `key` {string | Buffer | TypedArray | DataView}
- `iv` {string | Buffer | TypedArray | DataView} * `iv` {string | Buffer | TypedArray | DataView}
- `options` {Object} [`stream.transform` options][] * `options` {Object} [`stream.transform` options][]
- Returns: {Cipher} * Returns: {Cipher}
Creates and returns a `Cipher` object, with the given `algorithm`, `key` and Creates and returns a `Cipher` object, with the given `algorithm`, `key` and
initialization vector (`iv`). initialization vector (`iv`).
@ -1423,10 +1423,10 @@ deprecated: v10.0.0
> Stability: 0 - Deprecated: Use [`crypto.createDecipheriv()`][] instead. > Stability: 0 - Deprecated: Use [`crypto.createDecipheriv()`][] instead.
- `algorithm` {string} * `algorithm` {string}
- `password` {string | Buffer | TypedArray | DataView} * `password` {string | Buffer | TypedArray | DataView}
- `options` {Object} [`stream.transform` options][] * `options` {Object} [`stream.transform` options][]
- Returns: {Decipher} * Returns: {Decipher}
Creates and returns a `Decipher` object that uses the given `algorithm` and Creates and returns a `Decipher` object that uses the given `algorithm` and
`password` (key). `password` (key).
@ -1461,11 +1461,11 @@ changes:
description: The `iv` parameter may now be `null` for ciphers which do not description: The `iv` parameter may now be `null` for ciphers which do not
need an initialization vector. need an initialization vector.
--> -->
- `algorithm` {string} * `algorithm` {string}
- `key` {string | Buffer | TypedArray | DataView} * `key` {string | Buffer | TypedArray | DataView}
- `iv` {string | Buffer | TypedArray | DataView} * `iv` {string | Buffer | TypedArray | DataView}
- `options` {Object} [`stream.transform` options][] * `options` {Object} [`stream.transform` options][]
- Returns: {Decipher} * Returns: {Decipher}
Creates and returns a `Decipher` object that uses the given `algorithm`, `key` Creates and returns a `Decipher` object that uses the given `algorithm`, `key`
and initialization vector (`iv`). and initialization vector (`iv`).
@ -1509,11 +1509,11 @@ changes:
description: The default for the encoding parameters changed description: The default for the encoding parameters changed
from `binary` to `utf8`. from `binary` to `utf8`.
--> -->
- `prime` {string | Buffer | TypedArray | DataView} * `prime` {string | Buffer | TypedArray | DataView}
- `primeEncoding` {string} * `primeEncoding` {string}
- `generator` {number | string | Buffer | TypedArray | DataView} **Default:** * `generator` {number | string | Buffer | TypedArray | DataView} **Default:**
`2` `2`
- `generatorEncoding` {string} * `generatorEncoding` {string}
Creates a `DiffieHellman` key exchange object using the supplied `prime` and an Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
optional specific `generator`. optional specific `generator`.
@ -1534,8 +1534,8 @@ otherwise a number, [`Buffer`][], `TypedArray`, or `DataView` is expected.
<!-- YAML <!-- YAML
added: v0.5.0 added: v0.5.0
--> -->
- `primeLength` {number} * `primeLength` {number}
- `generator` {number | string | Buffer | TypedArray | DataView} **Default:** * `generator` {number | string | Buffer | TypedArray | DataView} **Default:**
`2` `2`
Creates a `DiffieHellman` key exchange object and generates a prime of Creates a `DiffieHellman` key exchange object and generates a prime of
@ -1546,7 +1546,7 @@ If `generator` is not specified, the value `2` is used.
<!-- YAML <!-- YAML
added: v0.11.14 added: v0.11.14
--> -->
- `curveName` {string} * `curveName` {string}
Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a
predefined curve specified by the `curveName` string. Use predefined curve specified by the `curveName` string. Use
@ -1558,9 +1558,9 @@ and description of each available elliptic curve.
<!-- YAML <!-- YAML
added: v0.1.92 added: v0.1.92
--> -->
- `algorithm` {string} * `algorithm` {string}
- `options` {Object} [`stream.transform` options][] * `options` {Object} [`stream.transform` options][]
- Returns: {Hash} * Returns: {Hash}
Creates and returns a `Hash` object that can be used to generate hash digests Creates and returns a `Hash` object that can be used to generate hash digests
using the given `algorithm`. Optional `options` argument controls stream using the given `algorithm`. Optional `options` argument controls stream
@ -1596,10 +1596,10 @@ input.on('readable', () => {
<!-- YAML <!-- YAML
added: v0.1.94 added: v0.1.94
--> -->
- `algorithm` {string} * `algorithm` {string}
- `key` {string | Buffer | TypedArray | DataView} * `key` {string | Buffer | TypedArray | DataView}
- `options` {Object} [`stream.transform` options][] * `options` {Object} [`stream.transform` options][]
- Returns: {Hmac} * Returns: {Hmac}
Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. Creates and returns an `Hmac` object that uses the given `algorithm` and `key`.
Optional `options` argument controls stream behavior. Optional `options` argument controls stream behavior.
@ -1636,9 +1636,9 @@ input.on('readable', () => {
<!-- YAML <!-- YAML
added: v0.1.92 added: v0.1.92
--> -->
- `algorithm` {string} * `algorithm` {string}
- `options` {Object} [`stream.Writable` options][] * `options` {Object} [`stream.Writable` options][]
- Returns: {Sign} * Returns: {Sign}
Creates and returns a `Sign` object that uses the given `algorithm`. Creates and returns a `Sign` object that uses the given `algorithm`.
Use [`crypto.getHashes()`][] to obtain an array of names of the available Use [`crypto.getHashes()`][] to obtain an array of names of the available
@ -1649,9 +1649,9 @@ signing algorithms. Optional `options` argument controls the
<!-- YAML <!-- YAML
added: v0.1.92 added: v0.1.92
--> -->
- `algorithm` {string} * `algorithm` {string}
- `options` {Object} [`stream.Writable` options][] * `options` {Object} [`stream.Writable` options][]
- Returns: {Verify} * Returns: {Verify}
Creates and returns a `Verify` object that uses the given algorithm. Creates and returns a `Verify` object that uses the given algorithm.
Use [`crypto.getHashes()`][] to obtain an array of names of the available Use [`crypto.getHashes()`][] to obtain an array of names of the available
@ -1662,7 +1662,7 @@ signing algorithms. Optional `options` argument controls the
<!-- YAML <!-- YAML
added: v0.9.3 added: v0.9.3
--> -->
- Returns: {string[]} An array with the names of the supported cipher * Returns: {string[]} An array with the names of the supported cipher
algorithms. algorithms.
Example: Example:
@ -1676,7 +1676,7 @@ console.log(ciphers); // ['aes-128-cbc', 'aes-128-ccm', ...]
<!-- YAML <!-- YAML
added: v2.3.0 added: v2.3.0
--> -->
- Returns: {string[]} An array with the names of the supported elliptic curves. * Returns: {string[]} An array with the names of the supported elliptic curves.
Example: Example:
@ -1689,8 +1689,8 @@ console.log(curves); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]
<!-- YAML <!-- YAML
added: v0.7.5 added: v0.7.5
--> -->
- `groupName` {string} * `groupName` {string}
- Returns: {Object} * Returns: {Object}
Creates a predefined `DiffieHellman` key exchange object. The Creates a predefined `DiffieHellman` key exchange object. The
supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in
@ -1724,14 +1724,14 @@ console.log(aliceSecret === bobSecret);
<!-- YAML <!-- YAML
added: v10.0.0 added: v10.0.0
--> -->
- Returns: {boolean} `true` if and only if a FIPS compliant crypto provider is * Returns: {boolean} `true` if and only if a FIPS compliant crypto provider is
currently in use. currently in use.
### crypto.getHashes() ### crypto.getHashes()
<!-- YAML <!-- YAML
added: v0.9.3 added: v0.9.3
--> -->
- Returns: {string[]} An array of the names of the supported hash algorithms, * Returns: {string[]} An array of the names of the supported hash algorithms,
such as `'RSA-SHA256'`. such as `'RSA-SHA256'`.
Example: Example:
@ -1757,12 +1757,12 @@ changes:
description: The default encoding for `password` if it is a string changed description: The default encoding for `password` if it is a string changed
from `binary` to `utf8`. from `binary` to `utf8`.
--> -->
- `password` {string|Buffer|TypedArray|DataView} * `password` {string|Buffer|TypedArray|DataView}
- `salt` {string|Buffer|TypedArray|DataView} * `salt` {string|Buffer|TypedArray|DataView}
- `iterations` {number} * `iterations` {number}
- `keylen` {number} * `keylen` {number}
- `digest` {string} * `digest` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `derivedKey` {Buffer} - `derivedKey` {Buffer}
@ -1827,12 +1827,12 @@ changes:
description: The default encoding for `password` if it is a string changed description: The default encoding for `password` if it is a string changed
from `binary` to `utf8`. from `binary` to `utf8`.
--> -->
- `password` {string|Buffer|TypedArray|DataView} * `password` {string|Buffer|TypedArray|DataView}
- `salt` {string|Buffer|TypedArray|DataView} * `salt` {string|Buffer|TypedArray|DataView}
- `iterations` {number} * `iterations` {number}
- `keylen` {number} * `keylen` {number}
- `digest` {string} * `digest` {string}
- Returns: {Buffer} * Returns: {Buffer}
Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
implementation. A selected HMAC digest algorithm specified by `digest` is implementation. A selected HMAC digest algorithm specified by `digest` is
@ -1875,15 +1875,15 @@ An array of supported digest functions can be retrieved using
<!-- YAML <!-- YAML
added: v0.11.14 added: v0.11.14
--> -->
- `privateKey` {Object | string} * `privateKey` {Object | string}
- `key` {string} A PEM encoded private key. - `key` {string} A PEM encoded private key.
- `passphrase` {string} An optional passphrase for the private key. - `passphrase` {string} An optional passphrase for the private key.
- `padding` {crypto.constants} An optional padding value defined in - `padding` {crypto.constants} An optional padding value defined in
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
`crypto.constants.RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_PADDING`, or
`crypto.constants.RSA_PKCS1_OAEP_PADDING`. `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
- `buffer` {Buffer | TypedArray | DataView} * `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the decrypted content. * Returns: {Buffer} A new `Buffer` with the decrypted content.
Decrypts `buffer` with `privateKey`. Decrypts `buffer` with `privateKey`.
@ -1894,14 +1894,14 @@ treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`.
<!-- YAML <!-- YAML
added: v1.1.0 added: v1.1.0
--> -->
- `privateKey` {Object | string} * `privateKey` {Object | string}
- `key` {string} A PEM encoded private key. - `key` {string} A PEM encoded private key.
- `passphrase` {string} An optional passphrase for the private key. - `passphrase` {string} An optional passphrase for the private key.
- `padding` {crypto.constants} An optional padding value defined in - `padding` {crypto.constants} An optional padding value defined in
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or
`crypto.constants.RSA_PKCS1_PADDING`. `crypto.constants.RSA_PKCS1_PADDING`.
- `buffer` {Buffer | TypedArray | DataView} * `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the encrypted content. * Returns: {Buffer} A new `Buffer` with the encrypted content.
Encrypts `buffer` with `privateKey`. Encrypts `buffer` with `privateKey`.
@ -1912,14 +1912,14 @@ treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`.
<!-- YAML <!-- YAML
added: v1.1.0 added: v1.1.0
--> -->
- `key` {Object | string} * `key` {Object | string}
- `key` {string} A PEM encoded public or private key. - `key` {string} A PEM encoded public or private key.
- `passphrase` {string} An optional passphrase for the private key. - `passphrase` {string} An optional passphrase for the private key.
- `padding` {crypto.constants} An optional padding value defined in - `padding` {crypto.constants} An optional padding value defined in
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or
`crypto.constants.RSA_PKCS1_PADDING`. `crypto.constants.RSA_PKCS1_PADDING`.
- `buffer` {Buffer | TypedArray | DataView} * `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the decrypted content. * Returns: {Buffer} A new `Buffer` with the decrypted content.
Decrypts `buffer` with `key`. Decrypts `buffer` with `key`.
@ -1933,15 +1933,15 @@ be passed instead of a public key.
<!-- YAML <!-- YAML
added: v0.11.14 added: v0.11.14
--> -->
- `key` {Object | string} * `key` {Object | string}
- `key` {string} A PEM encoded public or private key. - `key` {string} A PEM encoded public or private key.
- `passphrase` {string} An optional passphrase for the private key. - `passphrase` {string} An optional passphrase for the private key.
- `padding` {crypto.constants} An optional padding value defined in - `padding` {crypto.constants} An optional padding value defined in
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
`crypto.constants.RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_PADDING`, or
`crypto.constants.RSA_PKCS1_OAEP_PADDING`. `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
- `buffer` {Buffer | TypedArray | DataView} * `buffer` {Buffer | TypedArray | DataView}
- Returns: {Buffer} A new `Buffer` with the encrypted content. * Returns: {Buffer} A new `Buffer` with the encrypted content.
Encrypts the content of `buffer` with `key` and returns a new Encrypts the content of `buffer` with `key` and returns a new
[`Buffer`][] with encrypted content. [`Buffer`][] with encrypted content.
@ -1961,11 +1961,11 @@ changes:
description: Passing `null` as the `callback` argument now throws description: Passing `null` as the `callback` argument now throws
`ERR_INVALID_CALLBACK`. `ERR_INVALID_CALLBACK`.
--> -->
- `size` {number} * `size` {number}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `buf` {Buffer} - `buf` {Buffer}
- Returns: {Buffer} if the `callback` function is not provided. * Returns: {Buffer} if the `callback` function is not provided.
Generates cryptographically strong pseudo-random data. The `size` argument Generates cryptographically strong pseudo-random data. The `size` argument
is a number indicating the number of bytes to generate. is a number indicating the number of bytes to generate.
@ -2125,17 +2125,17 @@ request.
<!-- YAML <!-- YAML
added: v10.5.0 added: v10.5.0
--> -->
- `password` {string|Buffer|TypedArray|DataView} * `password` {string|Buffer|TypedArray|DataView}
- `salt` {string|Buffer|TypedArray|DataView} * `salt` {string|Buffer|TypedArray|DataView}
- `keylen` {number} * `keylen` {number}
- `options` {Object} * `options` {Object}
- `N` {number} CPU/memory cost parameter. Must be a power of two greater - `N` {number} CPU/memory cost parameter. Must be a power of two greater
than one. **Default:** `16384`. than one. **Default:** `16384`.
- `r` {number} Block size parameter. **Default:** `8`. - `r` {number} Block size parameter. **Default:** `8`.
- `p` {number} Parallelization parameter. **Default:** `1`. - `p` {number} Parallelization parameter. **Default:** `1`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately) - `maxmem` {number} Memory upper bound. It is an error when (approximately)
`128 * N * r > maxmem`. **Default:** `32 * 1024 * 1024`. `128 * N * r > maxmem`. **Default:** `32 * 1024 * 1024`.
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `derivedKey` {Buffer} - `derivedKey` {Buffer}
@ -2171,17 +2171,17 @@ crypto.scrypt('secret', 'salt', 64, { N: 1024 }, (err, derivedKey) => {
<!-- YAML <!-- YAML
added: v10.5.0 added: v10.5.0
--> -->
- `password` {string|Buffer|TypedArray|DataView} * `password` {string|Buffer|TypedArray|DataView}
- `salt` {string|Buffer|TypedArray|DataView} * `salt` {string|Buffer|TypedArray|DataView}
- `keylen` {number} * `keylen` {number}
- `options` {Object} * `options` {Object}
- `N` {number} CPU/memory cost parameter. Must be a power of two greater - `N` {number} CPU/memory cost parameter. Must be a power of two greater
than one. **Default:** `16384`. than one. **Default:** `16384`.
- `r` {number} Block size parameter. **Default:** `8`. - `r` {number} Block size parameter. **Default:** `8`.
- `p` {number} Parallelization parameter. **Default:** `1`. - `p` {number} Parallelization parameter. **Default:** `1`.
- `maxmem` {number} Memory upper bound. It is an error when (approximately) - `maxmem` {number} Memory upper bound. It is an error when (approximately)
`128 * N * r > maxmem`. **Default:** `32 * 1024 * 1024`. `128 * N * r > maxmem`. **Default:** `32 * 1024 * 1024`.
- Returns: {Buffer} * Returns: {Buffer}
Provides a synchronous [scrypt][] implementation. Scrypt is a password-based Provides a synchronous [scrypt][] implementation. Scrypt is a password-based
key derivation function that is designed to be expensive computationally and key derivation function that is designed to be expensive computationally and
@ -2210,8 +2210,8 @@ console.log(key2.toString('hex')); // '3745e48...aa39b34'
<!-- YAML <!-- YAML
added: v0.11.11 added: v0.11.11
--> -->
- `engine` {string} * `engine` {string}
- `flags` {crypto.constants} **Default:** `crypto.constants.ENGINE_METHOD_ALL` * `flags` {crypto.constants} **Default:** `crypto.constants.ENGINE_METHOD_ALL`
Load and set the `engine` for some or all OpenSSL functions (selected by flags). Load and set the `engine` for some or all OpenSSL functions (selected by flags).
@ -2252,9 +2252,9 @@ Throws an error if FIPS mode is not available.
<!-- YAML <!-- YAML
added: v6.6.0 added: v6.6.0
--> -->
- `a` {Buffer | TypedArray | DataView} * `a` {Buffer | TypedArray | DataView}
- `b` {Buffer | TypedArray | DataView} * `b` {Buffer | TypedArray | DataView}
- Returns: {boolean} * Returns: {boolean}
This function is based on a constant-time algorithm. This function is based on a constant-time algorithm.
Returns true if `a` is equal to `b`, without leaking timing information that Returns true if `a` is equal to `b`, without leaking timing information that

View File

@ -208,6 +208,7 @@ socket.bind({
<!-- YAML <!-- YAML
added: v0.1.99 added: v0.1.99
--> -->
* `callback` {Function} Called when the socket has been closed.
Close the underlying socket and stop listening for data on it. If a callback is Close the underlying socket and stop listening for data on it. If a callback is
provided, it is added as a listener for the [`'close'`][] event. provided, it is added as a listener for the [`'close'`][] event.

View File

@ -134,8 +134,8 @@ changes:
pr-url: https://github.com/nodejs/node/pull/744 pr-url: https://github.com/nodejs/node/pull/744
description: The `all` option is supported now. description: The `all` option is supported now.
--> -->
- `hostname` {string} * `hostname` {string}
- `options` {integer | Object} * `options` {integer | Object}
- `family` {integer} The record family. Must be `4` or `6`. IPv4 - `family` {integer} The record family. Must be `4` or `6`. IPv4
and IPv6 addresses are both returned by default. and IPv6 addresses are both returned by default.
- `hints` {number} One or more [supported `getaddrinfo` flags][]. Multiple - `hints` {number} One or more [supported `getaddrinfo` flags][]. Multiple
@ -148,7 +148,7 @@ changes:
**Default:** currently `false` (addresses are reordered) but this is **Default:** currently `false` (addresses are reordered) but this is
expected to change in the not too distant future. expected to change in the not too distant future.
New code should use `{ verbatim: true }`. New code should use `{ verbatim: true }`.
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `address` {string} A string representation of an IPv4 or IPv6 address. - `address` {string} A string representation of an IPv4 or IPv6 address.
- `family` {integer} `4` or `6`, denoting the family of `address`. - `family` {integer} `4` or `6`, denoting the family of `address`.
@ -213,9 +213,9 @@ on some operating systems (e.g FreeBSD 10.1).
<!-- YAML <!-- YAML
added: v0.11.14 added: v0.11.14
--> -->
- `address` {string} * `address` {string}
- `port` {number} * `port` {number}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `hostname` {string} e.g. `example.com` - `hostname` {string} e.g. `example.com`
- `service` {string} e.g. `http` - `service` {string} e.g. `http`
@ -244,9 +244,9 @@ If this method is invoked as its [`util.promisify()`][]ed version, it returns a
<!-- YAML <!-- YAML
added: v0.1.27 added: v0.1.27
--> -->
- `hostname` {string} Hostname to resolve. * `hostname` {string} Hostname to resolve.
- `rrtype` {string} Resource record type. **Default:** `'A'`. * `rrtype` {string} Resource record type. **Default:** `'A'`.
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `records` {string[] | Object[] | Object} - `records` {string[] | Object[] | Object}
@ -281,13 +281,13 @@ changes:
description: This method now supports passing `options`, description: This method now supports passing `options`,
specifically `options.ttl`. specifically `options.ttl`.
--> -->
- `hostname` {string} Hostname to resolve. * `hostname` {string} Hostname to resolve.
- `options` {Object} * `options` {Object}
- `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. - `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
When `true`, the callback receives an array of When `true`, the callback receives an array of
`{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings,
with the TTL expressed in seconds. with the TTL expressed in seconds.
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `addresses` {string[] | Object[]} - `addresses` {string[] | Object[]}
@ -305,13 +305,13 @@ changes:
description: This method now supports passing `options`, description: This method now supports passing `options`,
specifically `options.ttl`. specifically `options.ttl`.
--> -->
- `hostname` {string} Hostname to resolve. * `hostname` {string} Hostname to resolve.
- `options` {Object} * `options` {Object}
- `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. - `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
When `true`, the callback receives an array of When `true`, the callback receives an array of
`{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of
strings, with the TTL expressed in seconds. strings, with the TTL expressed in seconds.
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `addresses` {string[] | Object[]} - `addresses` {string[] | Object[]}
@ -321,8 +321,8 @@ will contain an array of IPv6 addresses.
## dns.resolveAny(hostname, callback) ## dns.resolveAny(hostname, callback)
- `hostname` {string} * `hostname` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `ret` {Object[]} - `ret` {Object[]}
@ -368,8 +368,8 @@ Here is an example of the `ret` object passed to the callback:
<!-- YAML <!-- YAML
added: v0.3.2 added: v0.3.2
--> -->
- `hostname` {string} * `hostname` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `addresses` {string[]} - `addresses` {string[]}
@ -382,8 +382,8 @@ will contain an array of canonical name records available for the `hostname`
<!-- YAML <!-- YAML
added: v0.1.27 added: v0.1.27
--> -->
- `hostname` {string} * `hostname` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `addresses` {Object[]} - `addresses` {Object[]}
@ -396,8 +396,8 @@ property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
<!-- YAML <!-- YAML
added: v0.9.12 added: v0.9.12
--> -->
- `hostname` {string} * `hostname` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `addresses` {Object[]} - `addresses` {Object[]}
@ -428,8 +428,8 @@ function will contain an array of objects with the following properties:
<!-- YAML <!-- YAML
added: v0.1.90 added: v0.1.90
--> -->
- `hostname` {string} * `hostname` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `addresses` {string[]} - `addresses` {string[]}
@ -442,8 +442,8 @@ contain an array of name server records available for `hostname`
<!-- YAML <!-- YAML
added: v6.0.0 added: v6.0.0
--> -->
- `hostname` {string} * `hostname` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `addresses` {string[]} - `addresses` {string[]}
@ -455,8 +455,8 @@ be an array of strings containing the reply records.
<!-- YAML <!-- YAML
added: v0.11.10 added: v0.11.10
--> -->
- `hostname` {string} * `hostname` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `address` {Object} - `address` {Object}
@ -489,8 +489,8 @@ be an object with the following properties:
<!-- YAML <!-- YAML
added: v0.1.27 added: v0.1.27
--> -->
- `hostname` {string} * `hostname` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `addresses` {Object[]} - `addresses` {Object[]}
@ -517,8 +517,8 @@ be an array of objects with the following properties:
<!-- YAML <!-- YAML
added: v0.1.27 added: v0.1.27
--> -->
- `hostname` {string} * `hostname` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `records` {string[][]} - `records` {string[][]}
@ -533,8 +533,8 @@ treated separately.
<!-- YAML <!-- YAML
added: v0.1.16 added: v0.1.16
--> -->
- `ip` {string} * `ip` {string}
- `callback` {Function} * `callback` {Function}
- `err` {Error} - `err` {Error}
- `hostnames` {string[]} - `hostnames` {string[]}
@ -548,7 +548,7 @@ one of the [DNS error codes][].
<!-- YAML <!-- YAML
added: v0.11.3 added: v0.11.3
--> -->
- `servers` {string[]} array of [rfc5952][] formatted addresses * `servers` {string[]} array of [rfc5952][] formatted addresses
Sets the IP address and port of servers to be used when performing DNS Sets the IP address and port of servers to be used when performing DNS
resolution. The `servers` argument is an array of [rfc5952][] formatted resolution. The `servers` argument is an array of [rfc5952][] formatted
@ -654,8 +654,8 @@ section if a custom port is used.
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} * `hostname` {string}
- `options` {integer | Object} * `options` {integer | Object}
- `family` {integer} The record family. Must be `4` or `6`. IPv4 - `family` {integer} The record family. Must be `4` or `6`. IPv4
and IPv6 addresses are both returned by default. and IPv6 addresses are both returned by default.
- `hints` {number} One or more [supported `getaddrinfo` flags][]. Multiple - `hints` {number} One or more [supported `getaddrinfo` flags][]. Multiple
@ -717,8 +717,8 @@ dnsPromises.lookup('example.com', options).then((result) => {
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `address` {string} * `address` {string}
- `port` {number} * `port` {number}
Resolves the given `address` and `port` into a hostname and service using Resolves the given `address` and `port` into a hostname and service using
the operating system's underlying `getnameinfo` implementation. the operating system's underlying `getnameinfo` implementation.
@ -742,8 +742,8 @@ dnsPromises.lookupService('127.0.0.1', 22).then((result) => {
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} Hostname to resolve. * `hostname` {string} Hostname to resolve.
- `rrtype` {string} Resource record type. **Default:** `'A'`. * `rrtype` {string} Resource record type. **Default:** `'A'`.
Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an array Uses the DNS protocol to resolve a hostname (e.g. `'nodejs.org'`) into an array
of the resource records. When successful, the `Promise` is resolved with an of the resource records. When successful, the `Promise` is resolved with an
@ -771,8 +771,8 @@ is one of the [DNS error codes](#dns_error_codes).
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} Hostname to resolve. * `hostname` {string} Hostname to resolve.
- `options` {Object} * `options` {Object}
- `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. - `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
When `true`, the `Promise` is resolved with an array of When `true`, the `Promise` is resolved with an array of
`{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings,
@ -786,8 +786,8 @@ addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} Hostname to resolve. * `hostname` {string} Hostname to resolve.
- `options` {Object} * `options` {Object}
- `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. - `ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record.
When `true`, the `Promise` is resolved with an array of When `true`, the `Promise` is resolved with an array of
`{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of
@ -801,7 +801,7 @@ addresses.
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} * `hostname` {string}
Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
On success, the `Promise` is resolved with an array containing various types of On success, the `Promise` is resolved with an array containing various types of
@ -845,7 +845,7 @@ Here is an example of the result object:
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} * `hostname` {string}
Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success,
the `Promise` is resolved with an array of canonical name records available for the `Promise` is resolved with an array of canonical name records available for
@ -855,7 +855,7 @@ the `hostname` (e.g. `['bar.example.com']`).
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} * `hostname` {string}
Uses the DNS protocol to resolve mail exchange records (`MX` records) for the Uses the DNS protocol to resolve mail exchange records (`MX` records) for the
`hostname`. On success, the `Promise` is resolved with an array of objects `hostname`. On success, the `Promise` is resolved with an array of objects
@ -866,7 +866,7 @@ containing both a `priority` and `exchange` property (e.g.
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} * `hostname` {string}
Uses the DNS protocol to resolve regular expression based records (`NAPTR` Uses the DNS protocol to resolve regular expression based records (`NAPTR`
records) for the `hostname`. On success, the `Promise` is resolved with an array records) for the `hostname`. On success, the `Promise` is resolved with an array
@ -895,7 +895,7 @@ of objects with the following properties:
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} * `hostname` {string}
Uses the DNS protocol to resolve name server records (`NS` records) for the Uses the DNS protocol to resolve name server records (`NS` records) for the
`hostname`. On success, the `Promise` is resolved with an array of name server `hostname`. On success, the `Promise` is resolved with an array of name server
@ -906,7 +906,7 @@ records available for `hostname` (e.g.
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} * `hostname` {string}
Uses the DNS protocol to resolve pointer records (`PTR` records) for the Uses the DNS protocol to resolve pointer records (`PTR` records) for the
`hostname`. On success, the `Promise` is resolved with an array of strings `hostname`. On success, the `Promise` is resolved with an array of strings
@ -916,7 +916,7 @@ containing the reply records.
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} * `hostname` {string}
Uses the DNS protocol to resolve a start of authority record (`SOA` record) for Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
the `hostname`. On success, the `Promise` is resolved with an object with the the `hostname`. On success, the `Promise` is resolved with an object with the
@ -947,7 +947,7 @@ following properties:
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} * `hostname` {string}
Uses the DNS protocol to resolve service records (`SRV` records) for the Uses the DNS protocol to resolve service records (`SRV` records) for the
`hostname`. On success, the `Promise` is resolved with an array of objects with `hostname`. On success, the `Promise` is resolved with an array of objects with
@ -972,7 +972,7 @@ the following properties:
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `hostname` {string} * `hostname` {string}
Uses the DNS protocol to resolve text queries (`TXT` records) for the Uses the DNS protocol to resolve text queries (`TXT` records) for the
`hostname`. On success, the `Promise` is resolved with a two-dimensional array `hostname`. On success, the `Promise` is resolved with a two-dimensional array
@ -985,7 +985,7 @@ treated separately.
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `ip` {string} * `ip` {string}
Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
array of hostnames. array of hostnames.
@ -997,7 +997,7 @@ is one of the [DNS error codes](#dns_error_codes).
<!-- YAML <!-- YAML
added: v10.6.0 added: v10.6.0
--> -->
- `servers` {string[]} array of [rfc5952][] formatted addresses * `servers` {string[]} array of [rfc5952][] formatted addresses
Sets the IP address and port of servers to be used when performing DNS Sets the IP address and port of servers to be used when performing DNS
resolution. The `servers` argument is an array of [rfc5952][] formatted resolution. The `servers` argument is an array of [rfc5952][] formatted

View File

@ -228,6 +228,8 @@ The `'removeListener'` event is emitted *after* the `listener` is removed.
added: v0.9.12 added: v0.9.12
deprecated: v4.0.0 deprecated: v4.0.0
--> -->
* `emitter` {EventEmitter} The emitter to query
* `eventName` {string|symbol} The event name
> Stability: 0 - Deprecated: Use [`emitter.listenerCount()`][] instead. > Stability: 0 - Deprecated: Use [`emitter.listenerCount()`][] instead.
@ -286,8 +288,8 @@ Its `name` property is set to `'MaxListenersExceededWarning'`.
<!-- YAML <!-- YAML
added: v0.1.26 added: v0.1.26
--> -->
- `eventName` {string|symbol} * `eventName` {string|symbol}
- `listener` {Function} * `listener` {Function}
Alias for `emitter.on(eventName, listener)`. Alias for `emitter.on(eventName, listener)`.
@ -295,9 +297,9 @@ Alias for `emitter.on(eventName, listener)`.
<!-- YAML <!-- YAML
added: v0.1.26 added: v0.1.26
--> -->
- `eventName` {string|symbol} * `eventName` {string|symbol}
- `...args` {any} - `...args` {any}
- Returns: {boolean} * Returns: {boolean}
Synchronously calls each of the listeners registered for the event named Synchronously calls each of the listeners registered for the event named
`eventName`, in the order they were registered, passing the supplied arguments `eventName`, in the order they were registered, passing the supplied arguments
@ -310,7 +312,7 @@ Returns `true` if the event had listeners, `false` otherwise.
added: v6.0.0 added: v6.0.0
--> -->
- Returns: {Array} * Returns: {Array}
Returns an array listing the events for which the emitter has registered Returns an array listing the events for which the emitter has registered
listeners. The values in the array will be strings or `Symbol`s. listeners. The values in the array will be strings or `Symbol`s.
@ -333,7 +335,7 @@ console.log(myEE.eventNames());
added: v1.0.0 added: v1.0.0
--> -->
- Returns: {integer} * Returns: {integer}
Returns the current max listener value for the `EventEmitter` which is either Returns the current max listener value for the `EventEmitter` which is either
set by [`emitter.setMaxListeners(n)`][] or defaults to set by [`emitter.setMaxListeners(n)`][] or defaults to
@ -358,8 +360,8 @@ changes:
description: For listeners attached using `.once()` this returns the description: For listeners attached using `.once()` this returns the
original listeners instead of wrapper functions now. original listeners instead of wrapper functions now.
--> -->
- `eventName` {string|symbol} * `eventName` {string|symbol}
- Returns: {Function[]} * Returns: {Function[]}
Returns a copy of the array of listeners for the event named `eventName`. Returns a copy of the array of listeners for the event named `eventName`.
@ -501,8 +503,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
<!-- YAML <!-- YAML
added: v0.1.26 added: v0.1.26
--> -->
- `eventName` {string|symbol} * `eventName` {string|symbol}
- Returns: {EventEmitter} * Returns: {EventEmitter}
Removes all listeners, or those of the specified `eventName`. Removes all listeners, or those of the specified `eventName`.
@ -516,9 +518,9 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
<!-- YAML <!-- YAML
added: v0.1.26 added: v0.1.26
--> -->
- `eventName` {string|symbol} * `eventName` {string|symbol}
- `listener` {Function} * `listener` {Function}
- Returns: {EventEmitter} * Returns: {EventEmitter}
Removes the specified `listener` from the listener array for the event named Removes the specified `listener` from the listener array for the event named
`eventName`. `eventName`.
@ -585,8 +587,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
<!-- YAML <!-- YAML
added: v0.3.5 added: v0.3.5
--> -->
- `n` {integer} * `n` {integer}
- Returns: {EventEmitter} * Returns: {EventEmitter}
By default `EventEmitter`s will print a warning if more than `10` listeners are By default `EventEmitter`s will print a warning if more than `10` listeners are
added for a particular event. This is a useful default that helps finding added for a particular event. This is a useful default that helps finding
@ -601,8 +603,8 @@ Returns a reference to the `EventEmitter`, so that calls can be chained.
<!-- YAML <!-- YAML
added: v9.4.0 added: v9.4.0
--> -->
- `eventName` {string|symbol} * `eventName` {string|symbol}
- Returns: {Function[]} * Returns: {Function[]}
Returns a copy of the array of listeners for the event named `eventName`, Returns a copy of the array of listeners for the event named `eventName`,
including any wrappers (such as those created by `.once()`). including any wrappers (such as those created by `.once()`).

View File

@ -1781,14 +1781,14 @@ changes:
pr-url: https://github.com/nodejs/node/pull/15752 pr-url: https://github.com/nodejs/node/pull/15752
description: The `options` argument is supported now. description: The `options` argument is supported now.
--> -->
- `options` {Object} * `options` {Object}
* `IncomingMessage` {http.IncomingMessage} Specifies the `IncomingMessage` * `IncomingMessage` {http.IncomingMessage} Specifies the `IncomingMessage`
class to be used. Useful for extending the original `IncomingMessage`. class to be used. Useful for extending the original `IncomingMessage`.
**Default:** `IncomingMessage`. **Default:** `IncomingMessage`.
* `ServerResponse` {http.ServerResponse} Specifies the `ServerResponse` class * `ServerResponse` {http.ServerResponse} Specifies the `ServerResponse` class
to be used. Useful for extending the original `ServerResponse`. **Default:** to be used. Useful for extending the original `ServerResponse`. **Default:**
`ServerResponse`. `ServerResponse`.
- `requestListener` {Function} * `requestListener` {Function}
* Returns: {http.Server} * Returns: {http.Server}

View File

@ -1609,7 +1609,7 @@ a given number of milliseconds set using `http2server.setTimeout()`.
<!-- YAML <!-- YAML
added: v8.4.0 added: v8.4.0
--> -->
- `callback` {Function} * `callback` {Function}
Stops the server from accepting new connections. See [`net.Server.close()`][]. Stops the server from accepting new connections. See [`net.Server.close()`][].
@ -1728,7 +1728,7 @@ the connection is terminated. See the [Compatibility API][].
<!-- YAML <!-- YAML
added: v8.4.0 added: v8.4.0
--> -->
- `callback` {Function} * `callback` {Function}
Stops the server from accepting new connections. See [`tls.Server.close()`][]. Stops the server from accepting new connections. See [`tls.Server.close()`][].
@ -3139,6 +3139,8 @@ will result in a [`TypeError`][] being thrown.
<!-- YAML <!-- YAML
added: v8.4.0 added: v8.4.0
--> -->
* `headers` {HTTP/2 Headers Object} An object describing the headers
* `callback` {Function}
Call [`http2stream.pushStream()`][] with the given headers, and wraps the Call [`http2stream.pushStream()`][] with the given headers, and wraps the
given newly created [`Http2Stream`] on `Http2ServerResponse`. given newly created [`Http2Stream`] on `Http2ServerResponse`.

View File

@ -27,7 +27,7 @@ This class is a subclass of `tls.Server` and emits events same as
<!-- YAML <!-- YAML
added: v0.1.90 added: v0.1.90
--> -->
- `callback` {Function} * `callback` {Function}
See [`server.close()`][`http.close()`] from the HTTP module for details. See [`server.close()`][`http.close()`] from the HTTP module for details.
@ -47,8 +47,8 @@ See [`http.Server#maxHeadersCount`][].
<!-- YAML <!-- YAML
added: v0.11.2 added: v0.11.2
--> -->
- `msecs` {number} **Default:** `120000` (2 minutes) * `msecs` {number} **Default:** `120000` (2 minutes)
- `callback` {Function} * `callback` {Function}
See [`http.Server#setTimeout()`][]. See [`http.Server#setTimeout()`][].
@ -72,9 +72,9 @@ See [`http.Server#keepAliveTimeout`][].
<!-- YAML <!-- YAML
added: v0.3.4 added: v0.3.4
--> -->
- `options` {Object} Accepts `options` from [`tls.createServer()`][], * `options` {Object} Accepts `options` from [`tls.createServer()`][],
[`tls.createSecureContext()`][] and [`http.createServer()`][]. [`tls.createSecureContext()`][] and [`http.createServer()`][].
- `requestListener` {Function} A listener to be added to the `'request'` event. * `requestListener` {Function} A listener to be added to the `'request'` event.
Example: Example:
@ -124,9 +124,9 @@ changes:
description: The `options` parameter can be a WHATWG `URL` object. description: The `options` parameter can be a WHATWG `URL` object.
--> -->
- `url` {string | URL} - `url` {string | URL}
- `options` {Object} Accepts the same `options` as * `options` {Object | string | URL} Accepts the same `options` as
[`https.request()`][], with the `method` always set to `GET`. [`https.request()`][], with the `method` always set to `GET`.
- `callback` {Function} * `callback` {Function}
Like [`http.get()`][] but for HTTPS. Like [`http.get()`][] but for HTTPS.
@ -175,12 +175,12 @@ changes:
description: The `options` parameter can be a WHATWG `URL` object. description: The `options` parameter can be a WHATWG `URL` object.
--> -->
- `url` {string | URL} - `url` {string | URL}
- `options` {Object} Accepts all `options` from * `options` {Object | string | URL} Accepts all `options` from
[`http.request()`][], with some differences in default values: [`http.request()`][], with some differences in default values:
- `protocol` **Default:** `'https:'` - `protocol` **Default:** `'https:'`
- `port` **Default:** `443` - `port` **Default:** `443`
- `agent` **Default:** `https.globalAgent` - `agent` **Default:** `https.globalAgent`
- `callback` {Function} * `callback` {Function}
Makes a request to a secure web server. Makes a request to a secure web server.

View File

@ -64,10 +64,12 @@ This class is used to create a TCP or [IPC][] server.
### new net.Server([options][, connectionListener]) ### new net.Server([options][, connectionListener])
* `options` {Object} See
[`net.createServer([options][, connectionListener])`][`net.createServer()`].
* `connectionListener` {Function} Automatically set as a listener for the
[`'connection'`][] event.
* Returns: {net.Server} * Returns: {net.Server}
See [`net.createServer([options][, connectionListener])`][`net.createServer()`].
`net.Server` is an [`EventEmitter`][] with the following events: `net.Server` is an [`EventEmitter`][] with the following events:
### Event: 'close' ### Event: 'close'
@ -145,6 +147,7 @@ Don't call `server.address()` until the `'listening'` event has been emitted.
added: v0.1.90 added: v0.1.90
--> -->
* `callback` {Function} Called when the server is closed
* Returns: {net.Server} * Returns: {net.Server}
Stops the server from accepting new connections and keeps existing Stops the server from accepting new connections and keeps existing
@ -173,6 +176,7 @@ connections use asynchronous [`server.getConnections()`][] instead.
added: v0.9.7 added: v0.9.7
--> -->
* `callback` {Function}
* Returns: {net.Server} * Returns: {net.Server}
Asynchronously get the number of concurrent connections on the server. Works Asynchronously get the number of concurrent connections on the server. Works
@ -394,8 +398,6 @@ it to interact with the client.
added: v0.3.4 added: v0.3.4
--> -->
Creates a new socket object.
* `options` {Object} Available options are: * `options` {Object} Available options are:
* `fd` {number} If specified, wrap around an existing socket with * `fd` {number} If specified, wrap around an existing socket with
the given file descriptor, otherwise a new socket will be created. the given file descriptor, otherwise a new socket will be created.
@ -408,6 +410,8 @@ Creates a new socket object.
otherwise ignored. **Default:** `false`. otherwise ignored. **Default:** `false`.
* Returns: {net.Socket} * Returns: {net.Socket}
Creates a new socket object.
The newly created socket can be either a TCP socket or a streaming [IPC][] The newly created socket can be either a TCP socket or a streaming [IPC][]
endpoint, depending on what it [`connect()`][`socket.connect()`] to. endpoint, depending on what it [`connect()`][`socket.connect()`] to.
@ -668,6 +672,7 @@ callback.
added: v0.1.90 added: v0.1.90
--> -->
* `exception` {Object}
* Returns: {net.Socket} * Returns: {net.Socket}
Ensures that no more I/O activity happens on this socket. Only necessary in Ensures that no more I/O activity happens on this socket. Only necessary in
@ -686,6 +691,8 @@ listeners for that event will receive `exception` as an argument.
added: v0.1.90 added: v0.1.90
--> -->
* `data` {string|Buffer|Uint8Array}
* `encoding` {string} Only used when data is `string`. **Default:** `'utf8'`.
* Returns: {net.Socket} The socket itself. * Returns: {net.Socket} The socket itself.
Half-closes the socket. i.e., it sends a FIN packet. It is possible the Half-closes the socket. i.e., it sends a FIN packet. It is possible the
@ -765,6 +772,7 @@ Resumes reading after a call to [`socket.pause()`][].
added: v0.1.90 added: v0.1.90
--> -->
* `encoding` {string}
* Returns: {net.Socket} The socket itself. * Returns: {net.Socket} The socket itself.
Set the encoding for the socket as a [Readable Stream][]. See Set the encoding for the socket as a [Readable Stream][]. See
@ -804,6 +812,8 @@ algorithm, they buffer data before sending it off. Setting `true` for
added: v0.1.90 added: v0.1.90
--> -->
* `timeout` {number}
* `callback` {Function}
* Returns: {net.Socket} The socket itself. * Returns: {net.Socket} The socket itself.
Sets the socket to timeout after `timeout` milliseconds of inactivity on Sets the socket to timeout after `timeout` milliseconds of inactivity on
@ -877,6 +887,8 @@ Possible signatures:
<!-- YAML <!-- YAML
added: v0.7.0 added: v0.7.0
--> -->
* `options` {Object}
* `connectListener` {Function}
Alias to Alias to
[`net.createConnection(options[, connectListener])`][`net.createConnection(options)`]. [`net.createConnection(options[, connectListener])`][`net.createConnection(options)`].
@ -884,6 +896,8 @@ Alias to
<!-- YAML <!-- YAML
added: v0.1.90 added: v0.1.90
--> -->
* `path` {string}
* `connectListener` {Function}
Alias to Alias to
[`net.createConnection(path[, connectListener])`][`net.createConnection(path)`]. [`net.createConnection(path[, connectListener])`][`net.createConnection(path)`].
@ -892,6 +906,9 @@ Alias to
<!-- YAML <!-- YAML
added: v0.1.90 added: v0.1.90
--> -->
* `port` {number}
* `host` {string}
* `connectListener` {Function}
Alias to Alias to
[`net.createConnection(port[, host][, connectListener])`][`net.createConnection(port, host)`]. [`net.createConnection(port[, host][, connectListener])`][`net.createConnection(port, host)`].
@ -1014,6 +1031,8 @@ then returns the `net.Socket` that starts the connection.
<!-- YAML <!-- YAML
added: v0.5.0 added: v0.5.0
--> -->
* `options` {Object}
* `connectionListener` {Function}
Creates a new TCP or [IPC][] server. Creates a new TCP or [IPC][] server.
@ -1089,6 +1108,7 @@ $ nc -U /tmp/echo.sock
added: v0.3.0 added: v0.3.0
--> -->
* `input` {string}
* Returns: {integer} * Returns: {integer}
Tests if input is an IP address. Returns `0` for invalid strings, Tests if input is an IP address. Returns `0` for invalid strings,
@ -1100,6 +1120,7 @@ addresses.
added: v0.3.0 added: v0.3.0
--> -->
* `input` {string}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if input is a version 4 IP address, otherwise returns `false`. Returns `true` if input is a version 4 IP address, otherwise returns `false`.
@ -1109,6 +1130,7 @@ Returns `true` if input is a version 4 IP address, otherwise returns `false`.
added: v0.3.0 added: v0.3.0
--> -->
* `input` {string}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if input is a version 6 IP address, otherwise returns `false`. Returns `true` if input is a version 6 IP address, otherwise returns `false`.

View File

@ -1695,6 +1695,7 @@ This feature is not available in [`Worker`][] threads.
<!-- YAML <!-- YAML
added: v0.1.28 added: v0.1.28
--> -->
* `id` {integer | string}
The `process.setuid(id)` method sets the user identity of the process. (See The `process.setuid(id)` method sets the user identity of the process. (See
setuid(2).) The `id` can be passed as either a numeric ID or a username string. setuid(2).) The `id` can be passed as either a numeric ID or a username string.

View File

@ -363,6 +363,7 @@ See also: [`writable.uncork()`][].
added: v8.0.0 added: v8.0.0
--> -->
* `error` {Error}
* Returns: {this} * Returns: {this}
Destroy the stream, and emit the passed `'error'` and a `'close'` event. Destroy the stream, and emit the passed `'error'` and a `'close'` event.
@ -1285,6 +1286,7 @@ Examples of `Transform` streams include:
<!-- YAML <!-- YAML
added: v8.0.0 added: v8.0.0
--> -->
* `error` {Error}
Destroy the stream, and emit `'error'`. After this call, the Destroy the stream, and emit `'error'`. After this call, the
transform stream would release any internal resources. transform stream would release any internal resources.

View File

@ -60,6 +60,11 @@ A `boolean` that is always `true` for `tty.ReadStream` instances.
added: v0.7.7 added: v0.7.7
--> -->
* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a
raw device. If `false`, configures the `tty.ReadStream` to operate in its
default mode. The `readStream.isRaw` property will be set to the resulting
mode.
Allows configuration of `tty.ReadStream` so that it operates as a raw device. Allows configuration of `tty.ReadStream` so that it operates as a raw device.
When in raw mode, input is always available character-by-character, not When in raw mode, input is always available character-by-character, not
@ -67,11 +72,6 @@ including modifiers. Additionally, all special processing of characters by the
terminal is disabled, including echoing input characters. terminal is disabled, including echoing input characters.
Note that `CTRL`+`C` will no longer cause a `SIGINT` when in this mode. Note that `CTRL`+`C` will no longer cause a `SIGINT` when in this mode.
* `mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a
raw device. If `false`, configures the `tty.ReadStream` to operate in its
default mode. The `readStream.isRaw` property will be set to the resulting
mode.
## Class: tty.WriteStream ## Class: tty.WriteStream
<!-- YAML <!-- YAML
added: v0.5.8 added: v0.5.8

View File

@ -298,13 +298,13 @@ changes:
description: The `constructor` parameter can refer to an ES6 class now. description: The `constructor` parameter can refer to an ES6 class now.
--> -->
* `constructor` {Function}
* `superConstructor` {Function}
Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and
`extends` keywords to get language level inheritance support. Also note `extends` keywords to get language level inheritance support. Also note
that the two styles are [semantically incompatible][]. that the two styles are [semantically incompatible][].
* `constructor` {Function}
* `superConstructor` {Function}
Inherit the prototype methods from one [constructor][] into another. The Inherit the prototype methods from one [constructor][] into another. The
prototype of `constructor` will be set to a new object created from prototype of `constructor` will be set to a new object created from
`superConstructor`. `superConstructor`.
@ -939,6 +939,7 @@ useful for addon developers who prefer to do type checking in JavaScript.
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`ArrayBuffer`][] or Returns `true` if the value is a built-in [`ArrayBuffer`][] or
@ -959,6 +960,7 @@ util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is an `arguments` object. Returns `true` if the value is an `arguments` object.
@ -977,6 +979,7 @@ function foo() {
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`ArrayBuffer`][] instance. Returns `true` if the value is a built-in [`ArrayBuffer`][] instance.
@ -995,6 +998,7 @@ util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is an [async function][]. Returns `true` if the value is an [async function][].
@ -1014,6 +1018,7 @@ util.types.isAsyncFunction(async function foo() {}); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a `BigInt64Array` instance. The Returns `true` if the value is a `BigInt64Array` instance. The
@ -1033,6 +1038,7 @@ util.types.isBigInt64Array(new BigUint64Array()); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a `BigUint64Array` instance. The Returns `true` if the value is a `BigUint64Array` instance. The
@ -1052,6 +1058,7 @@ util.types.isBigUint64Array(new BigUint64Array()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a boolean object, e.g. created Returns `true` if the value is a boolean object, e.g. created
@ -1073,6 +1080,7 @@ util.types.isBooleanObject(Boolean(true)); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`DataView`][] instance. Returns `true` if the value is a built-in [`DataView`][] instance.
@ -1092,6 +1100,7 @@ See also [`ArrayBuffer.isView()`][].
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Date`][] instance. Returns `true` if the value is a built-in [`Date`][] instance.
@ -1107,6 +1116,7 @@ util.types.isDate(new Date()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a native `External` value. Returns `true` if the value is a native `External` value.
@ -1116,6 +1126,7 @@ Returns `true` if the value is a native `External` value.
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Float32Array`][] instance. Returns `true` if the value is a built-in [`Float32Array`][] instance.
@ -1133,6 +1144,7 @@ util.types.isFloat32Array(new Float64Array()); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Float64Array`][] instance. Returns `true` if the value is a built-in [`Float64Array`][] instance.
@ -1150,6 +1162,7 @@ util.types.isFloat64Array(new Float64Array()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a generator function. Returns `true` if the value is a generator function.
@ -1169,6 +1182,7 @@ util.types.isGeneratorFunction(function* foo() {}); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a generator object as returned from a Returns `true` if the value is a generator object as returned from a
@ -1190,6 +1204,7 @@ util.types.isGeneratorObject(generator); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Int8Array`][] instance. Returns `true` if the value is a built-in [`Int8Array`][] instance.
@ -1207,6 +1222,7 @@ util.types.isInt8Array(new Float64Array()); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Int16Array`][] instance. Returns `true` if the value is a built-in [`Int16Array`][] instance.
@ -1224,6 +1240,7 @@ util.types.isInt16Array(new Float64Array()); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Int32Array`][] instance. Returns `true` if the value is a built-in [`Int32Array`][] instance.
@ -1241,6 +1258,7 @@ util.types.isInt32Array(new Float64Array()); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Map`][] instance. Returns `true` if the value is a built-in [`Map`][] instance.
@ -1256,6 +1274,7 @@ util.types.isMap(new Map()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is an iterator returned for a built-in Returns `true` if the value is an iterator returned for a built-in
@ -1276,6 +1295,7 @@ util.types.isMapIterator(map[Symbol.iterator]()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is an instance of a [Module Namespace Object][]. Returns `true` if the value is an instance of a [Module Namespace Object][].
@ -1294,6 +1314,7 @@ util.types.isModuleNamespaceObject(ns); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is an instance of a built-in [`Error`][] type. Returns `true` if the value is an instance of a built-in [`Error`][] type.
@ -1311,6 +1332,7 @@ util.types.isNativeError(new RangeError()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a number object, e.g. created Returns `true` if the value is a number object, e.g. created
@ -1328,6 +1350,7 @@ util.types.isNumberObject(new Number(0)); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Promise`][]. Returns `true` if the value is a built-in [`Promise`][].
@ -1343,6 +1366,7 @@ util.types.isPromise(Promise.resolve(42)); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a [`Proxy`][] instance. Returns `true` if the value is a [`Proxy`][] instance.
@ -1361,6 +1385,7 @@ util.types.isProxy(proxy); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a regular expression object. Returns `true` if the value is a regular expression object.
@ -1377,6 +1402,7 @@ util.types.isRegExp(new RegExp('abc')); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Set`][] instance. Returns `true` if the value is a built-in [`Set`][] instance.
@ -1392,6 +1418,7 @@ util.types.isSet(new Set()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is an iterator returned for a built-in Returns `true` if the value is an iterator returned for a built-in
@ -1412,6 +1439,7 @@ util.types.isSetIterator(set[Symbol.iterator]()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`SharedArrayBuffer`][] instance. Returns `true` if the value is a built-in [`SharedArrayBuffer`][] instance.
@ -1430,6 +1458,7 @@ util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a string object, e.g. created Returns `true` if the value is a string object, e.g. created
@ -1447,6 +1476,7 @@ util.types.isStringObject(new String('foo')); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a symbol object, created Returns `true` if the value is a symbol object, created
@ -1465,6 +1495,7 @@ util.types.isSymbolObject(Object(symbol)); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`TypedArray`][] instance. Returns `true` if the value is a built-in [`TypedArray`][] instance.
@ -1484,6 +1515,7 @@ See also [`ArrayBuffer.isView()`][].
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Uint8Array`][] instance. Returns `true` if the value is a built-in [`Uint8Array`][] instance.
@ -1501,6 +1533,7 @@ util.types.isUint8Array(new Float64Array()); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Uint8ClampedArray`][] instance. Returns `true` if the value is a built-in [`Uint8ClampedArray`][] instance.
@ -1518,6 +1551,7 @@ util.types.isUint8ClampedArray(new Float64Array()); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Uint16Array`][] instance. Returns `true` if the value is a built-in [`Uint16Array`][] instance.
@ -1535,6 +1569,7 @@ util.types.isUint16Array(new Float64Array()); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`Uint32Array`][] instance. Returns `true` if the value is a built-in [`Uint32Array`][] instance.
@ -1552,6 +1587,7 @@ util.types.isUint32Array(new Float64Array()); // Returns false
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`WeakMap`][] instance. Returns `true` if the value is a built-in [`WeakMap`][] instance.
@ -1567,6 +1603,7 @@ util.types.isWeakMap(new WeakMap()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`WeakSet`][] instance. Returns `true` if the value is a built-in [`WeakSet`][] instance.
@ -1582,6 +1619,7 @@ util.types.isWeakSet(new WeakSet()); // Returns true
added: v10.0.0 added: v10.0.0
--> -->
* `value` {any}
* Returns: {boolean} * Returns: {boolean}
Returns `true` if the value is a built-in [`WebAssembly.Module`][] instance. Returns `true` if the value is a built-in [`WebAssembly.Module`][] instance.
@ -1603,6 +1641,8 @@ applications and modules should be updated to find alternative approaches.
added: v0.7.5 added: v0.7.5
deprecated: v6.0.0 deprecated: v6.0.0
--> -->
* `target` {Object}
* `source` {Object}
> Stability: 0 - Deprecated: Use [`Object.assign()`] instead. > Stability: 0 - Deprecated: Use [`Object.assign()`] instead.

View File

@ -175,6 +175,7 @@ changes to the API or wire format) may occur until this warning is removed.
added: v8.0.0 added: v8.0.0
--> -->
* `value` {any}
* Returns: {Buffer} * Returns: {Buffer}
Uses a [`DefaultSerializer`][] to serialize `value` into a buffer. Uses a [`DefaultSerializer`][] to serialize `value` into a buffer.
@ -203,6 +204,8 @@ Writes out a header, which includes the serialization format version.
#### serializer.writeValue(value) #### serializer.writeValue(value)
* `value` {any}
Serializes a JavaScript value and adds the serialized representation to the Serializes a JavaScript value and adds the serialized representation to the
internal buffer. internal buffer.
@ -362,6 +365,7 @@ For use inside of a custom [`deserializer._readHostObject()`][].
#### deserializer.readRawBytes(length) #### deserializer.readRawBytes(length)
* `length` {integer}
* Returns: {Buffer} * Returns: {Buffer}
Read raw bytes from the deserializers internal buffer. The `length` parameter Read raw bytes from the deserializers internal buffer. The `length` parameter

View File

@ -428,6 +428,8 @@ as appropriate for the derived class).
added: v0.9.4 added: v0.9.4
--> -->
* `callback` {Function}
Close the underlying handle. Close the underlying handle.
### zlib.flush([kind], callback) ### zlib.flush([kind], callback)
@ -436,6 +438,7 @@ added: v0.5.8
--> -->
* `kind` **Default:** `zlib.constants.Z_FULL_FLUSH` * `kind` **Default:** `zlib.constants.Z_FULL_FLUSH`
* `callback` {Function}
Flush pending data. Don't call this frivolously, premature flushes negatively Flush pending data. Don't call this frivolously, premature flushes negatively
impact the effectiveness of the compression algorithm. impact the effectiveness of the compression algorithm.
@ -450,6 +453,10 @@ writes and will only produce output when data is being read from the stream.
added: v0.11.4 added: v0.11.4
--> -->
* `level` {integer}
* `strategy` {integer}
* `callback` {Function}
Dynamically update the compression level and compression strategy. Dynamically update the compression level and compression strategy.
Only applicable to deflate algorithm. Only applicable to deflate algorithm.
@ -473,6 +480,8 @@ Provides an object enumerating Zlib-related constants.
added: v0.5.8 added: v0.5.8
--> -->
* `options` {Object}
Creates and returns a new [`Deflate`][] object with the given [`options`][]. Creates and returns a new [`Deflate`][] object with the given [`options`][].
## zlib.createDeflateRaw([options]) ## zlib.createDeflateRaw([options])
@ -480,6 +489,8 @@ Creates and returns a new [`Deflate`][] object with the given [`options`][].
added: v0.5.8 added: v0.5.8
--> -->
* `options` {Object}
Creates and returns a new [`DeflateRaw`][] object with the given [`options`][]. Creates and returns a new [`DeflateRaw`][] object with the given [`options`][].
An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when `windowBits` An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when `windowBits`
@ -494,6 +505,8 @@ that effectively uses an 8-bit window only.
added: v0.5.8 added: v0.5.8
--> -->
* `options` {Object}
Creates and returns a new [`Gunzip`][] object with the given [`options`][]. Creates and returns a new [`Gunzip`][] object with the given [`options`][].
## zlib.createGzip([options]) ## zlib.createGzip([options])
@ -501,6 +514,8 @@ Creates and returns a new [`Gunzip`][] object with the given [`options`][].
added: v0.5.8 added: v0.5.8
--> -->
* `options` {Object}
Creates and returns a new [`Gzip`][] object with the given [`options`][]. Creates and returns a new [`Gzip`][] object with the given [`options`][].
## zlib.createInflate([options]) ## zlib.createInflate([options])
@ -508,6 +523,8 @@ Creates and returns a new [`Gzip`][] object with the given [`options`][].
added: v0.5.8 added: v0.5.8
--> -->
* `options` {Object}
Creates and returns a new [`Inflate`][] object with the given [`options`][]. Creates and returns a new [`Inflate`][] object with the given [`options`][].
## zlib.createInflateRaw([options]) ## zlib.createInflateRaw([options])
@ -515,6 +532,8 @@ Creates and returns a new [`Inflate`][] object with the given [`options`][].
added: v0.5.8 added: v0.5.8
--> -->
* `options` {Object}
Creates and returns a new [`InflateRaw`][] object with the given [`options`][]. Creates and returns a new [`InflateRaw`][] object with the given [`options`][].
## zlib.createUnzip([options]) ## zlib.createUnzip([options])
@ -522,6 +541,8 @@ Creates and returns a new [`InflateRaw`][] object with the given [`options`][].
added: v0.5.8 added: v0.5.8
--> -->
* `options` {Object}
Creates and returns a new [`Unzip`][] object with the given [`options`][]. Creates and returns a new [`Unzip`][] object with the given [`options`][].
## Convenience Methods ## Convenience Methods
@ -550,6 +571,10 @@ changes:
pr-url: https://github.com/nodejs/node/pull/12001 pr-url: https://github.com/nodejs/node/pull/12001
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
* `callback` {Function}
### zlib.deflateSync(buffer[, options]) ### zlib.deflateSync(buffer[, options])
<!-- YAML <!-- YAML
added: v0.11.12 added: v0.11.12
@ -565,7 +590,8 @@ changes:
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
Compress a chunk of data with [`Deflate`][]. Compress a chunk of data with [`Deflate`][].
@ -580,6 +606,11 @@ changes:
pr-url: https://github.com/nodejs/node/pull/12001 pr-url: https://github.com/nodejs/node/pull/12001
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
* `callback` {Function}
### zlib.deflateRawSync(buffer[, options]) ### zlib.deflateRawSync(buffer[, options])
<!-- YAML <!-- YAML
added: v0.11.12 added: v0.11.12
@ -595,7 +626,8 @@ changes:
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
Compress a chunk of data with [`DeflateRaw`][]. Compress a chunk of data with [`DeflateRaw`][].
@ -613,6 +645,11 @@ changes:
pr-url: https://github.com/nodejs/node/pull/12001 pr-url: https://github.com/nodejs/node/pull/12001
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
* `callback` {Function}
### zlib.gunzipSync(buffer[, options]) ### zlib.gunzipSync(buffer[, options])
<!-- YAML <!-- YAML
added: v0.11.12 added: v0.11.12
@ -628,7 +665,8 @@ changes:
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
Decompress a chunk of data with [`Gunzip`][]. Decompress a chunk of data with [`Gunzip`][].
@ -646,6 +684,11 @@ changes:
pr-url: https://github.com/nodejs/node/pull/12001 pr-url: https://github.com/nodejs/node/pull/12001
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
* `callback` {Function}
### zlib.gzipSync(buffer[, options]) ### zlib.gzipSync(buffer[, options])
<!-- YAML <!-- YAML
added: v0.11.12 added: v0.11.12
@ -661,7 +704,8 @@ changes:
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
Compress a chunk of data with [`Gzip`][]. Compress a chunk of data with [`Gzip`][].
@ -679,6 +723,11 @@ changes:
pr-url: https://github.com/nodejs/node/pull/12001 pr-url: https://github.com/nodejs/node/pull/12001
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
* `callback` {Function}
### zlib.inflateSync(buffer[, options]) ### zlib.inflateSync(buffer[, options])
<!-- YAML <!-- YAML
added: v0.11.12 added: v0.11.12
@ -694,7 +743,8 @@ changes:
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
Decompress a chunk of data with [`Inflate`][]. Decompress a chunk of data with [`Inflate`][].
@ -712,6 +762,11 @@ changes:
pr-url: https://github.com/nodejs/node/pull/12001 pr-url: https://github.com/nodejs/node/pull/12001
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
* `callback` {Function}
### zlib.inflateRawSync(buffer[, options]) ### zlib.inflateRawSync(buffer[, options])
<!-- YAML <!-- YAML
added: v0.11.12 added: v0.11.12
@ -727,7 +782,8 @@ changes:
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
Decompress a chunk of data with [`InflateRaw`][]. Decompress a chunk of data with [`InflateRaw`][].
@ -745,6 +801,11 @@ changes:
pr-url: https://github.com/nodejs/node/pull/12001 pr-url: https://github.com/nodejs/node/pull/12001
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
* `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
* `callback` {Function}
### zlib.unzipSync(buffer[, options]) ### zlib.unzipSync(buffer[, options])
<!-- YAML <!-- YAML
added: v0.11.12 added: v0.11.12
@ -760,7 +821,8 @@ changes:
description: The `buffer` parameter can be an `Uint8Array` now. description: The `buffer` parameter can be an `Uint8Array` now.
--> -->
- `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string} * `buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}
* `options` {Object}
Decompress a chunk of data with [`Unzip`][]. Decompress a chunk of data with [`Unzip`][].