diff options
Diffstat (limited to 'doc')
41 files changed, 465 insertions, 465 deletions
diff --git a/doc/api/assert.md b/doc/api/assert.md index c2978b1f4f..7df70f60c3 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -142,7 +142,7 @@ lax: assert.deepEqual(/a/gi, new Date()); ``` -## assert(value[, message]) +## assert(value\[, message\]) <!-- YAML added: v0.5.9 --> @@ -152,7 +152,7 @@ added: v0.5.9 An alias of [`assert.ok()`][]. -## assert.deepEqual(actual, expected[, message]) +## assert.deepEqual(actual, expected\[, message\]) <!-- YAML added: v0.1.21 changes: @@ -267,7 +267,7 @@ parameter is undefined, a default error message is assigned. If the `message` parameter is an instance of an [`Error`][] then it will be thrown instead of the [`AssertionError`][]. -## assert.deepStrictEqual(actual, expected[, message]) +## assert.deepStrictEqual(actual, expected\[, message\]) <!-- YAML added: v1.2.0 changes: @@ -421,7 +421,7 @@ parameter is undefined, a default error message is assigned. If the `message` parameter is an instance of an [`Error`][] then it will be thrown instead of the `AssertionError`. -## assert.doesNotReject(asyncFn[, error][, message]) +## assert.doesNotReject(asyncFn\[, error\]\[, message\]) <!-- YAML added: v10.0.0 --> @@ -471,7 +471,7 @@ assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) }); ``` -## assert.doesNotThrow(fn[, error][, message]) +## assert.doesNotThrow(fn\[, error\]\[, message\]) <!-- YAML added: v0.1.21 changes: @@ -547,7 +547,7 @@ assert.doesNotThrow( // Throws: AssertionError: Got unwanted exception: Whoops ``` -## assert.equal(actual, expected[, message]) +## assert.equal(actual, expected\[, message\]) <!-- YAML added: v0.1.21 --> @@ -587,7 +587,7 @@ parameter is undefined, a default error message is assigned. If the `message` parameter is an instance of an [`Error`][] then it will be thrown instead of the `AssertionError`. -## assert.fail([message]) +## assert.fail(\[message\]) <!-- YAML added: v0.1.21 --> @@ -614,7 +614,7 @@ assert.fail(new TypeError('need array')); Using `assert.fail()` with more than two arguments is possible but deprecated. See below for further details. -## assert.fail(actual, expected[, message[, operator[, stackStartFn]]]) +## assert.fail(actual, expected\[, message\[, operator\[, stackStartFn\]\]\]) <!-- YAML added: v0.1.21 changes: @@ -724,7 +724,7 @@ let err; // at errorFrame ``` -## assert.notDeepEqual(actual, expected[, message]) +## assert.notDeepEqual(actual, expected\[, message\]) <!-- YAML added: v0.1.21 changes: @@ -798,7 +798,7 @@ If the values are deeply equal, an [`AssertionError`][] is thrown with a `message` parameter is an instance of an [`Error`][] then it will be thrown instead of the `AssertionError`. -## assert.notDeepStrictEqual(actual, expected[, message]) +## assert.notDeepStrictEqual(actual, expected\[, message\]) <!-- YAML added: v1.2.0 changes: @@ -846,7 +846,7 @@ the `message` parameter is undefined, a default error message is assigned. If the `message` parameter is an instance of an [`Error`][] then it will be thrown instead of the [`AssertionError`][]. -## assert.notEqual(actual, expected[, message]) +## assert.notEqual(actual, expected\[, message\]) <!-- YAML added: v0.1.21 --> @@ -885,7 +885,7 @@ parameter is undefined, a default error message is assigned. If the `message` parameter is an instance of an [`Error`][] then it will be thrown instead of the `AssertionError`. -## assert.notStrictEqual(actual, expected[, message]) +## assert.notStrictEqual(actual, expected\[, message\]) <!-- YAML added: v0.1.21 changes: @@ -922,7 +922,7 @@ If the values are strictly equal, an [`AssertionError`][] is thrown with a `message` parameter is an instance of an [`Error`][] then it will be thrown instead of the `AssertionError`. -## assert.ok(value[, message]) +## assert.ok(value\[, message\]) <!-- YAML added: v0.1.21 changes: @@ -990,7 +990,7 @@ assert(0); // assert(0) ``` -## assert.rejects(asyncFn[, error][, message]) +## assert.rejects(asyncFn\[, error\]\[, message\]) <!-- YAML added: v10.0.0 --> @@ -1049,7 +1049,7 @@ argument, then `error` is assumed to be omitted and the string will be used for example in [`assert.throws()`][] carefully if using a string as the second argument gets considered. -## assert.strictEqual(actual, expected[, message]) +## assert.strictEqual(actual, expected\[, message\]) <!-- YAML added: v0.1.21 changes: @@ -1099,7 +1099,7 @@ If the values are not strictly equal, an [`AssertionError`][] is thrown with a `message` parameter is an instance of an [`Error`][] then it will be thrown instead of the [`AssertionError`][]. -## assert.throws(fn[, error][, message]) +## assert.throws(fn\[, error\]\[, message\]) <!-- YAML added: v0.1.21 changes: diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 90ff343ae0..2d981652ef 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -615,7 +615,7 @@ asyncResource.asyncId(); asyncResource.triggerAsyncId(); ``` -#### new AsyncResource(type[, options]) +#### new AsyncResource(type\[, options\]) * `type` {string} The type of async event. * `options` {Object} @@ -649,7 +649,7 @@ class DBQuery extends AsyncResource { } ``` -#### asyncResource.runInAsyncScope(fn[, thisArg, ...args]) +#### asyncResource.runInAsyncScope(fn\[, thisArg, ...args\]) <!-- YAML added: v9.6.0 --> diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 2d37c65b8d..b1fa5167d0 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -343,7 +343,7 @@ Allocates a new `Buffer` using an `array` of octets. const buf = new Buffer([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); ``` -### new Buffer(arrayBuffer[, byteOffset[, length]]) +### new Buffer(arrayBuffer\[, byteOffset\[, length\]\]) <!-- YAML added: v3.0.0 deprecated: v6.0.0 @@ -477,7 +477,7 @@ console.log(buf); // Prints: <Buffer 00 00 00 00 00 00 00 00 00 00> ``` -### new Buffer(string[, encoding]) +### new Buffer(string\[, encoding\]) <!-- YAML deprecated: v6.0.0 changes: @@ -514,7 +514,7 @@ console.log(buf1.toString('ascii')); // Prints: this is a tC)st ``` -### Class Method: Buffer.alloc(size[, fill[, encoding]]) +### Class Method: Buffer.alloc(size\[, fill\[, encoding\]\]) <!-- YAML added: v5.10.0 changes: @@ -677,7 +677,7 @@ developer has observed undue memory retention in their applications. A `TypeError` will be thrown if `size` is not a number. -### Class Method: Buffer.byteLength(string[, encoding]) +### Class Method: Buffer.byteLength(string\[, encoding\]) <!-- YAML added: v0.1.90 changes: @@ -742,7 +742,7 @@ console.log(arr.sort(Buffer.compare)); // (This result is equal to: [buf2, buf1].) ``` -### Class Method: Buffer.concat(list[, totalLength]) +### Class Method: Buffer.concat(list\[, totalLength\]) <!-- YAML added: v0.7.11 changes: @@ -808,7 +808,7 @@ const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); A `TypeError` will be thrown if `array` is not an `Array` or other type appropriate for `Buffer.from()` variants. -### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) +### Class Method: Buffer.from(arrayBuffer\[, byteOffset\[, length\]\]) <!-- YAML added: v5.10.0 --> @@ -882,7 +882,7 @@ console.log(buf2.toString()); A `TypeError` will be thrown if `buffer` is not a `Buffer` or other type appropriate for `Buffer.from()` variants. -### Class Method: Buffer.from(object[, offsetOrEncoding[, length]]) +### Class Method: Buffer.from(object\[, offsetOrEncoding\[, length\]\]) <!-- YAML added: v8.2.0 --> @@ -919,7 +919,7 @@ const buf = Buffer.from(new Foo(), 'utf8'); A `TypeError` will be thrown if `object` has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants. -### Class Method: Buffer.from(string[, encoding]) +### Class Method: Buffer.from(string\[, encoding\]) <!-- YAML added: v5.10.0 --> @@ -990,7 +990,7 @@ added: v0.11.3 This is the size (in bytes) of pre-allocated internal `Buffer` instances used for pooling. This value may be modified. -### buf[index] +### buf\[index\] <!-- YAML type: property name: [index] @@ -1058,7 +1058,7 @@ const nodeBuffer = new Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); new Int8Array(nodeBuffer.buffer, nodeBuffer.byteOffset, nodeBuffer.length); ``` -### buf.compare(target[, targetStart[, targetEnd[, sourceStart[, sourceEnd]]]]) +### buf.compare(target\[, targetStart\[, targetEnd\[, sourceStart\[, sourceEnd\]\]\]\]) <!-- YAML added: v0.11.13 changes: @@ -1129,7 +1129,7 @@ console.log(buf1.compare(buf2, 5, 6, 5)); [`ERR_OUT_OF_RANGE`][] is thrown if `targetStart < 0`, `sourceStart < 0`, `targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. -### buf.copy(target[, targetStart[, sourceStart[, sourceEnd]]]) +### buf.copy(target\[, targetStart\[, sourceStart\[, sourceEnd\]\]\]) <!-- YAML added: v0.1.90 --> @@ -1234,7 +1234,7 @@ console.log(buf1.equals(buf3)); // Prints: false ``` -### buf.fill(value[, offset[, end]][, encoding]) +### buf.fill(value\[, offset\[, end\]\]\[, encoding\]) <!-- YAML added: v0.5.0 changes: @@ -1306,7 +1306,7 @@ console.log(buf.fill('zz', 'hex')); // Throws an exception. ``` -### buf.includes(value[, byteOffset][, encoding]) +### buf.includes(value\[, byteOffset\]\[, encoding\]) <!-- YAML added: v5.3.0 --> @@ -1339,7 +1339,7 @@ console.log(buf.includes('this', 4)); // Prints: false ``` -### buf.indexOf(value[, byteOffset][, encoding]) +### buf.indexOf(value\[, byteOffset\]\[, encoding\]) <!-- YAML added: v1.5.0 changes: @@ -1446,7 +1446,7 @@ for (const key of buf.keys()) { // 5 ``` -### buf.lastIndexOf(value[, byteOffset][, encoding]) +### buf.lastIndexOf(value\[, byteOffset\]\[, encoding\]) <!-- YAML added: v6.0.0 changes: @@ -1575,8 +1575,8 @@ deprecated: v8.0.0 The `buf.parent` property is a deprecated alias for `buf.buffer`. -### buf.readBigInt64BE([offset]) -### buf.readBigInt64LE([offset]) +### buf.readBigInt64BE(\[offset\]) +### buf.readBigInt64LE(\[offset\]) <!-- YAML added: v12.0.0 --> @@ -1591,8 +1591,8 @@ the specified endian format (`readBigInt64BE()` returns big endian, Integers read from a `Buffer` are interpreted as two's complement signed values. -### buf.readBigUInt64BE([offset]) -### buf.readBigUInt64LE([offset]) +### buf.readBigUInt64BE(\[offset\]) +### buf.readBigUInt64LE(\[offset\]) <!-- YAML added: v12.0.0 --> @@ -1615,8 +1615,8 @@ console.log(buf.readBigUInt64LE(0)); // Prints: 18446744069414584320n ``` -### buf.readDoubleBE([offset]) -### buf.readDoubleLE([offset]) +### buf.readDoubleBE(\[offset\]) +### buf.readDoubleLE(\[offset\]) <!-- YAML added: v0.11.15 changes: @@ -1645,8 +1645,8 @@ console.log(buf.readDoubleLE(1)); // Throws ERR_OUT_OF_RANGE. ``` -### buf.readFloatBE([offset]) -### buf.readFloatLE([offset]) +### buf.readFloatBE(\[offset\]) +### buf.readFloatLE(\[offset\]) <!-- YAML added: v0.11.15 changes: @@ -1675,7 +1675,7 @@ console.log(buf.readFloatLE(1)); // Throws ERR_OUT_OF_RANGE. ``` -### buf.readInt8([offset]) +### buf.readInt8(\[offset\]) <!-- YAML added: v0.5.0 changes: @@ -1704,8 +1704,8 @@ console.log(buf.readInt8(2)); // Throws ERR_OUT_OF_RANGE. ``` -### buf.readInt16BE([offset]) -### buf.readInt16LE([offset]) +### buf.readInt16BE(\[offset\]) +### buf.readInt16LE(\[offset\]) <!-- YAML added: v0.5.5 changes: @@ -1736,8 +1736,8 @@ console.log(buf.readInt16LE(1)); // Throws ERR_OUT_OF_RANGE. ``` -### buf.readInt32BE([offset]) -### buf.readInt32LE([offset]) +### buf.readInt32BE(\[offset\]) +### buf.readInt32LE(\[offset\]) <!-- YAML added: v0.5.5 changes: @@ -1802,7 +1802,7 @@ console.log(buf.readIntBE(1, 0).toString(16)); // Throws ERR_OUT_OF_RANGE. ``` -### buf.readUInt8([offset]) +### buf.readUInt8(\[offset\]) <!-- YAML added: v0.5.0 changes: @@ -1829,8 +1829,8 @@ console.log(buf.readUInt8(2)); // Throws ERR_OUT_OF_RANGE. ``` -### buf.readUInt16BE([offset]) -### buf.readUInt16LE([offset]) +### buf.readUInt16BE(\[offset\]) +### buf.readUInt16LE(\[offset\]) <!-- YAML added: v0.5.5 changes: @@ -1863,8 +1863,8 @@ console.log(buf.readUInt16LE(2).toString(16)); // Throws ERR_OUT_OF_RANGE. ``` -### buf.readUInt32BE([offset]) -### buf.readUInt32LE([offset]) +### buf.readUInt32BE(\[offset\]) +### buf.readUInt32LE(\[offset\]) <!-- YAML added: v0.5.5 changes: @@ -1925,7 +1925,7 @@ console.log(buf.readUIntBE(1, 6).toString(16)); // Throws ERR_OUT_OF_RANGE. ``` -### buf.subarray([start[, end]]) +### buf.subarray(\[start\[, end\]\]) <!-- YAML added: v3.0.0 --> @@ -1985,7 +1985,7 @@ console.log(buf.subarray(-5, -2).toString()); // (Equivalent to buf.subarray(1, 4).) ``` -### buf.slice([start[, end]]) +### buf.slice(\[start\[, end\]\]) <!-- YAML added: v0.3.0 changes: @@ -2146,7 +2146,7 @@ console.log(copy); // Prints: <Buffer 01 02 03 04 05> ``` -### buf.toString([encoding[, start[, end]]]) +### buf.toString(\[encoding\[, start\[, end\]\]\]) <!-- YAML added: v0.1.90 --> @@ -2222,7 +2222,7 @@ for (const value of buf) { // 114 ``` -### buf.write(string[, offset[, length]][, encoding]) +### buf.write(string\[, offset\[, length\]\]\[, encoding\]) <!-- YAML added: v0.1.90 --> @@ -2249,8 +2249,8 @@ console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); // Prints: 12 bytes: ½ + ¼ = ¾ ``` -### buf.writeBigInt64BE(value[, offset]) -### buf.writeBigInt64LE(value[, offset]) +### buf.writeBigInt64BE(value\[, offset\]) +### buf.writeBigInt64LE(value\[, offset\]) <!-- YAML added: v12.0.0 --> @@ -2275,8 +2275,8 @@ console.log(buf); // Prints: <Buffer 01 02 03 04 05 06 07 08> ``` -### buf.writeBigUInt64BE(value[, offset]) -### buf.writeBigUInt64LE(value[, offset]) +### buf.writeBigUInt64BE(value\[, offset\]) +### buf.writeBigUInt64LE(value\[, offset\]) <!-- YAML added: v12.0.0 --> @@ -2299,8 +2299,8 @@ console.log(buf); // Prints: <Buffer de fa ce ca fe fa ca de> ``` -### buf.writeDoubleBE(value[, offset]) -### buf.writeDoubleLE(value[, offset]) +### buf.writeDoubleBE(value\[, offset\]) +### buf.writeDoubleLE(value\[, offset\]) <!-- YAML added: v0.11.15 changes: @@ -2334,8 +2334,8 @@ console.log(buf); // Prints: <Buffer 77 be 9f 1a 2f dd 5e 40> ``` -### buf.writeFloatBE(value[, offset]) -### buf.writeFloatLE(value[, offset]) +### buf.writeFloatBE(value\[, offset\]) +### buf.writeFloatLE(value\[, offset\]) <!-- YAML added: v0.11.15 changes: @@ -2369,7 +2369,7 @@ console.log(buf); // Prints: <Buffer bb fe 4a 4f> ``` -### buf.writeInt8(value[, offset]) +### buf.writeInt8(value\[, offset\]) <!-- YAML added: v0.5.0 changes: @@ -2400,8 +2400,8 @@ console.log(buf); // Prints: <Buffer 02 fe> ``` -### buf.writeInt16BE(value[, offset]) -### buf.writeInt16LE(value[, offset]) +### buf.writeInt16BE(value\[, offset\]) +### buf.writeInt16LE(value\[, offset\]) <!-- YAML added: v0.5.5 changes: @@ -2433,8 +2433,8 @@ console.log(buf); // Prints: <Buffer 01 02 04 03> ``` -### buf.writeInt32BE(value[, offset]) -### buf.writeInt32LE(value[, offset]) +### buf.writeInt32BE(value\[, offset\]) +### buf.writeInt32LE(value\[, offset\]) <!-- YAML added: v0.5.5 changes: @@ -2502,7 +2502,7 @@ console.log(buf); // Prints: <Buffer ab 90 78 56 34 12> ``` -### buf.writeUInt8(value[, offset]) +### buf.writeUInt8(value\[, offset\]) <!-- YAML added: v0.5.0 changes: @@ -2533,8 +2533,8 @@ console.log(buf); // Prints: <Buffer 03 04 23 42> ``` -### buf.writeUInt16BE(value[, offset]) -### buf.writeUInt16LE(value[, offset]) +### buf.writeUInt16BE(value\[, offset\]) +### buf.writeUInt16LE(value\[, offset\]) <!-- YAML added: v0.5.5 changes: @@ -2570,8 +2570,8 @@ console.log(buf); // Prints: <Buffer ad de ef be> ``` -### buf.writeUInt32BE(value[, offset]) -### buf.writeUInt32LE(value[, offset]) +### buf.writeUInt32BE(value\[, offset\]) +### buf.writeUInt32LE(value\[, offset\]) <!-- YAML added: v0.5.5 changes: diff --git a/doc/api/child_process.md b/doc/api/child_process.md index ab4c4cb004..9f153175a1 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -129,7 +129,7 @@ exec('"my script.cmd" a b', (err, stdout, stderr) => { }); ``` -### child_process.exec(command[, options][, callback]) +### child_process.exec(command\[, options\]\[, callback\]) <!-- YAML added: v0.1.90 changes: @@ -233,7 +233,7 @@ async function lsExample() { lsExample(); ``` -### child_process.execFile(file[, args][, options][, callback]) +### child_process.execFile(file\[, args\]\[, options\]\[, callback\]) <!-- YAML added: v0.1.91 changes: @@ -317,7 +317,7 @@ getVersion(); function. Any input containing shell metacharacters may be used to trigger arbitrary command execution.** -### child_process.fork(modulePath[, args][, options]) +### child_process.fork(modulePath\[, args\]\[, options\]) <!-- YAML added: v0.5.0 changes: @@ -382,7 +382,7 @@ current process. The `shell` option available in [`child_process.spawn()`][] is not supported by `child_process.fork()` and will be ignored if set. -### child_process.spawn(command[, args][, options]) +### child_process.spawn(command\[, args\]\[, options\]) <!-- YAML added: v0.1.90 changes: @@ -686,7 +686,7 @@ Blocking calls like these are mostly useful for simplifying general-purpose scripting tasks and for simplifying the loading/processing of application configuration at startup. -### child_process.execFileSync(file[, args][, options]) +### child_process.execFileSync(file\[, args\]\[, options\]) <!-- YAML added: v0.11.12 changes: @@ -753,7 +753,7 @@ If the process times out or has a non-zero exit code, this method will throw an function. Any input containing shell metacharacters may be used to trigger arbitrary command execution.** -### child_process.execSync(command[, options]) +### child_process.execSync(command\[, options\]) <!-- YAML added: v0.11.12 changes: @@ -813,7 +813,7 @@ The [`Error`][] object will contain the entire result from **Never pass unsanitized user input to this function. Any input containing shell metacharacters may be used to trigger arbitrary command execution.** -### child_process.spawnSync(command[, args][, options]) +### child_process.spawnSync(command\[, args\]\[, options\]) <!-- YAML added: v0.11.12 changes: @@ -1038,7 +1038,7 @@ When the child process is a Node.js instance (e.g. spawned using [`child_process.fork()`][]), the `process.disconnect()` method can be invoked within the child process to close the IPC channel as well. -### subprocess.kill([signal]) +### subprocess.kill(\[signal\]) <!-- YAML added: v0.1.90 --> @@ -1148,7 +1148,7 @@ subprocess.unref(); subprocess.ref(); ``` -### subprocess.send(message[, sendHandle[, options]][, callback]) +### subprocess.send(message\[, sendHandle\[, options\]\]\[, callback\]) <!-- YAML added: v0.5.9 changes: diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 06f730e3ae..6ea11b08ae 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -415,7 +415,7 @@ if (cluster.isMaster) { } ``` -### worker.kill([signal='SIGTERM']) +### worker.kill(\[signal='SIGTERM'\]) <!-- YAML added: v0.9.12 --> @@ -456,7 +456,7 @@ Workers will call `process.exit(0)` if the `'disconnect'` event occurs on `process` and `.exitedAfterDisconnect` is not `true`. This protects against accidental disconnection. -### worker.send(message[, sendHandle][, callback]) +### worker.send(message\[, sendHandle\]\[, callback\]) <!-- YAML added: v0.7.0 changes: @@ -664,7 +664,7 @@ The `settings` object is the `cluster.settings` object at the time If accuracy is important, use `cluster.settings`. -## cluster.disconnect([callback]) +## cluster.disconnect(\[callback\]) <!-- YAML added: v0.7.7 --> @@ -682,7 +682,7 @@ finished. This can only be called from the master process. -## cluster.fork([env]) +## cluster.fork(\[env\]) <!-- YAML added: v0.6.0 --> @@ -777,7 +777,7 @@ the settings, including the default values. This object is not intended to be changed or set manually. -## cluster.setupMaster([settings]) +## cluster.setupMaster(\[settings\]) <!-- YAML added: v0.7.1 changes: diff --git a/doc/api/console.md b/doc/api/console.md index b9a5ea3035..5700e91411 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -77,7 +77,7 @@ const { Console } = require('console'); const { Console } = console; ``` -### new Console(stdout[, stderr][, ignoreErrors]) +### new Console(stdout\[, stderr\]\[, ignoreErrors\]) ### new Console(options) <!-- YAML changes: @@ -129,7 +129,7 @@ The global `console` is a special `Console` whose output is sent to new Console({ stdout: process.stdout, stderr: process.stderr }); ``` -### console.assert(value[, ...message]) +### console.assert(value\[, ...message\]) <!-- YAML added: v0.1.101 changes: @@ -171,7 +171,7 @@ operates similarly to the `clear` shell command. On Windows, `console.clear()` will clear only the output in the current terminal viewport for the Node.js binary. -### console.count([label]) +### console.count(\[label\]) <!-- YAML added: v8.3.0 --> @@ -204,7 +204,7 @@ undefined > ``` -### console.countReset([label]) +### console.countReset(\[label\]) <!-- YAML added: v8.3.0 --> @@ -226,7 +226,7 @@ undefined > ``` -### console.debug(data[, ...args]) +### console.debug(data\[, ...args\]) <!-- YAML added: v8.0.0 changes: @@ -240,7 +240,7 @@ changes: The `console.debug()` function is an alias for [`console.log()`][]. -### console.dir(obj[, options]) +### console.dir(obj\[, options\]) <!-- YAML added: v0.1.101 --> @@ -273,7 +273,7 @@ changes: This method calls `console.log()` passing it the arguments received. This method does not produce any XML formatting. -### console.error([data][, ...args]) +### console.error(\[data\]\[, ...args\]) <!-- YAML added: v0.1.100 --> @@ -298,7 +298,7 @@ If formatting elements (e.g. `%d`) are not found in the first string then [`util.inspect()`][] is called on each argument and the resulting string values are concatenated. See [`util.format()`][] for more information. -### console.group([...label]) +### console.group(\[...label\]) <!-- YAML added: v8.5.0 --> @@ -324,7 +324,7 @@ added: v8.5.0 Decreases indentation of subsequent lines by two spaces. -### console.info([data][, ...args]) +### console.info(\[data\]\[, ...args\]) <!-- YAML added: v0.1.100 --> @@ -334,7 +334,7 @@ added: v0.1.100 The `console.info()` function is an alias for [`console.log()`][]. -### console.log([data][, ...args]) +### console.log(\[data\]\[, ...args\]) <!-- YAML added: v0.1.100 --> @@ -357,7 +357,7 @@ console.log('count:', count); See [`util.format()`][] for more information. -### console.table(tabularData[, properties]) +### console.table(tabularData\[, properties\]) <!-- YAML added: v10.0.0 --> @@ -394,7 +394,7 @@ console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); // └─────────┴─────┘ ``` -### console.time([label]) +### console.time(\[label\]) <!-- YAML added: v0.1.104 --> @@ -406,7 +406,7 @@ are identified by a unique `label`. Use the same `label` when calling [`console.timeEnd()`][] to stop the timer and output the elapsed time in milliseconds to `stdout`. Timer durations are accurate to the sub-millisecond. -### console.timeEnd([label]) +### console.timeEnd(\[label\]) <!-- YAML added: v0.1.104 changes: @@ -428,7 +428,7 @@ console.timeEnd('100-elements'); // prints 100-elements: 225.438ms ``` -### console.timeLog([label][, ...data]) +### console.timeLog(\[label\]\[, ...data\]) <!-- YAML added: v10.7.0 --> @@ -448,7 +448,7 @@ doExpensiveProcess2(value); console.timeEnd('process'); ``` -### console.trace([message][, ...args]) +### console.trace(\[message\]\[, ...args\]) <!-- YAML added: v0.1.104 --> @@ -475,7 +475,7 @@ console.trace('Show me'); // at REPLServer.Interface._ttyWrite (readline.js:826:14) ``` -### console.warn([data][, ...args]) +### console.warn(\[data\]\[, ...args\]) <!-- YAML added: v0.1.100 --> @@ -490,7 +490,7 @@ The following methods are exposed by the V8 engine in the general API but do not display anything unless used in conjunction with the [inspector][] (`--inspect` flag). -### console.markTimeline([label]) +### console.markTimeline(\[label\]) <!-- YAML added: v8.0.0 --> @@ -501,7 +501,7 @@ This method does not display anything unless used in the inspector. The `console.markTimeline()` method is the deprecated form of [`console.timeStamp()`][]. -### console.profile([label]) +### console.profile(\[label\]) <!-- YAML added: v8.0.0 --> @@ -520,7 +520,7 @@ console.profileEnd('MyLabel'); // Adds the profile 'MyLabel' to the Profiles panel of the inspector. ``` -### console.profileEnd([label]) +### console.profileEnd(\[label\]) <!-- YAML added: v8.0.0 --> @@ -535,7 +535,7 @@ the report to the **Profiles** panel of the inspector. See If this method is called without a label, the most recently started profile is stopped. -### console.timeStamp([label]) +### console.timeStamp(\[label\]) <!-- YAML added: v8.0.0 --> @@ -546,7 +546,7 @@ This method does not display anything unless used in the inspector. The `console.timeStamp()` method adds an event with the label `'label'` to the **Timeline** panel of the inspector. -### console.timeline([label]) +### console.timeline(\[label\]) <!-- YAML added: v8.0.0 --> @@ -556,7 +556,7 @@ added: v8.0.0 This method does not display anything unless used in the inspector. The `console.timeline()` method is the deprecated form of [`console.time()`][]. -### console.timelineEnd([label]) +### console.timelineEnd(\[label\]) <!-- YAML added: v8.0.0 --> diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 0c98506f1b..b4f91c1d55 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -68,7 +68,7 @@ console.log(challenge.toString('utf8')); // Prints: the challenge as a UTF8 string ``` -### Certificate.exportPublicKey(spkac[, encoding]) +### Certificate.exportPublicKey(spkac\[, encoding\]) <!-- YAML added: v9.0.0 --> @@ -265,7 +265,7 @@ console.log(encrypted); // Prints: e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa ``` -### cipher.final([outputEncoding]) +### cipher.final(\[outputEncoding\]) <!-- YAML added: v0.1.94 --> @@ -279,7 +279,7 @@ Once the `cipher.final()` method has been called, the `Cipher` object can no longer be used to encrypt data. Attempts to call `cipher.final()` more than once will result in an error being thrown. -### cipher.setAAD(buffer[, options]) +### cipher.setAAD(buffer\[, options\]) <!-- YAML added: v1.0.0 --> @@ -312,7 +312,7 @@ added: v1.0.0 The `cipher.getAuthTag()` method should only be called after encryption has been completed using the [`cipher.final()`][] method. -### cipher.setAutoPadding([autoPadding]) +### cipher.setAutoPadding(\[autoPadding\]) <!-- YAML added: v0.7.1 --> @@ -332,7 +332,7 @@ using `0x0` instead of PKCS padding. The `cipher.setAutoPadding()` method must be called before [`cipher.final()`][]. -### cipher.update(data[, inputEncoding][, outputEncoding]) +### cipher.update(data\[, inputEncoding\]\[, outputEncoding\]) <!-- YAML added: v0.1.94 changes: @@ -459,7 +459,7 @@ console.log(decrypted); // Prints: some clear text data ``` -### decipher.final([outputEncoding]) +### decipher.final(\[outputEncoding\]) <!-- YAML added: v0.1.94 --> @@ -473,7 +473,7 @@ Once the `decipher.final()` method has been called, the `Decipher` object can no longer be used to decrypt data. Attempts to call `decipher.final()` more than once will result in an error being thrown. -### decipher.setAAD(buffer[, options]) +### decipher.setAAD(buffer\[, options\]) <!-- YAML added: v1.0.0 changes: @@ -523,7 +523,7 @@ is invalid according to [NIST SP 800-38D][] or does not match the value of the The `decipher.setAuthTag()` method must be called before [`decipher.final()`][] and can only be called once. -### decipher.setAutoPadding([autoPadding]) +### decipher.setAutoPadding(\[autoPadding\]) <!-- YAML added: v0.7.1 --> @@ -541,7 +541,7 @@ multiple of the ciphers block size. The `decipher.setAutoPadding()` method must be called before [`decipher.final()`][]. -### decipher.update(data[, inputEncoding][, outputEncoding]) +### decipher.update(data\[, inputEncoding\]\[, outputEncoding\]) <!-- YAML added: v0.1.94 changes: @@ -601,7 +601,7 @@ const bobSecret = bob.computeSecret(aliceKey); assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); ``` -### diffieHellman.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding]) +### diffieHellman.computeSecret(otherPublicKey\[, inputEncoding\]\[, outputEncoding\]) <!-- YAML added: v0.5.0 --> @@ -622,7 +622,7 @@ provided, `otherPublicKey` is expected to be a [`Buffer`][], If `outputEncoding` is given a string is returned; otherwise, a [`Buffer`][] is returned. -### diffieHellman.generateKeys([encoding]) +### diffieHellman.generateKeys(\[encoding\]) <!-- YAML added: v0.5.0 --> @@ -636,7 +636,7 @@ transferred to the other party. If `encoding` is provided a string is returned; otherwise a [`Buffer`][] is returned. -### diffieHellman.getGenerator([encoding]) +### diffieHellman.getGenerator(\[encoding\]) <!-- YAML added: v0.5.0 --> @@ -648,7 +648,7 @@ Returns the Diffie-Hellman generator in the specified `encoding`. If `encoding` is provided a string is returned; otherwise a [`Buffer`][] is returned. -### diffieHellman.getPrime([encoding]) +### diffieHellman.getPrime(\[encoding\]) <!-- YAML added: v0.5.0 --> @@ -660,7 +660,7 @@ Returns the Diffie-Hellman prime in the specified `encoding`. If `encoding` is provided a string is returned; otherwise a [`Buffer`][] is returned. -### diffieHellman.getPrivateKey([encoding]) +### diffieHellman.getPrivateKey(\[encoding\]) <!-- YAML added: v0.5.0 --> @@ -672,7 +672,7 @@ Returns the Diffie-Hellman private key in the specified `encoding`. If `encoding` is provided a string is returned; otherwise a [`Buffer`][] is returned. -### diffieHellman.getPublicKey([encoding]) +### diffieHellman.getPublicKey(\[encoding\]) <!-- YAML added: v0.5.0 --> @@ -684,7 +684,7 @@ Returns the Diffie-Hellman public key in the specified `encoding`. If `encoding` is provided a string is returned; otherwise a [`Buffer`][] is returned. -### diffieHellman.setPrivateKey(privateKey[, encoding]) +### diffieHellman.setPrivateKey(privateKey\[, encoding\]) <!-- YAML added: v0.5.0 --> @@ -697,7 +697,7 @@ Sets the Diffie-Hellman private key. If the `encoding` argument is provided, to be a string. If no `encoding` is provided, `privateKey` is expected to be a [`Buffer`][], `TypedArray`, or `DataView`. -### diffieHellman.setPublicKey(publicKey[, encoding]) +### diffieHellman.setPublicKey(publicKey\[, encoding\]) <!-- YAML added: v0.5.0 --> @@ -784,7 +784,7 @@ assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); // OK ``` -### Class Method: ECDH.convertKey(key, curve[, inputEncoding[, outputEncoding[, format]]]) +### Class Method: ECDH.convertKey(key, curve\[, inputEncoding\[, outputEncoding\[, format\]\]\]) <!-- YAML added: v10.0.0 --> @@ -832,7 +832,7 @@ const uncompressedKey = ECDH.convertKey(compressedKey, console.log(uncompressedKey === ecdh.getPublicKey('hex')); ``` -### ecdh.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding]) +### ecdh.computeSecret(otherPublicKey\[, inputEncoding\]\[, outputEncoding\]) <!-- YAML added: v0.11.14 changes: @@ -867,7 +867,7 @@ lies outside of the elliptic curve. Since `otherPublicKey` is usually supplied from a remote user over an insecure network, its recommended for developers to handle this exception accordingly. -### ecdh.generateKeys([encoding[, format]]) +### ecdh.generateKeys(\[encoding\[, format\]\]) <!-- YAML added: v0.11.14 --> @@ -887,7 +887,7 @@ The `format` argument specifies point encoding and can be `'compressed'` or If `encoding` is provided a string is returned; otherwise a [`Buffer`][] is returned. -### ecdh.getPrivateKey([encoding]) +### ecdh.getPrivateKey(\[encoding\]) <!-- YAML added: v0.11.14 --> @@ -898,7 +898,7 @@ added: v0.11.14 If `encoding` is specified, a string is returned; otherwise a [`Buffer`][] is returned. -### ecdh.getPublicKey([encoding][, format]) +### ecdh.getPublicKey(\[encoding\]\[, format\]) <!-- YAML added: v0.11.14 --> @@ -915,7 +915,7 @@ The `format` argument specifies point encoding and can be `'compressed'` or If `encoding` is specified, a string is returned; otherwise a [`Buffer`][] is returned. -### ecdh.setPrivateKey(privateKey[, encoding]) +### ecdh.setPrivateKey(privateKey\[, encoding\]) <!-- YAML added: v0.11.14 --> @@ -932,7 +932,7 @@ If `privateKey` is not valid for the curve specified when the `ECDH` object was created, an error is thrown. Upon setting the private key, the associated public point (key) is also generated and set in the `ECDH` object. -### ecdh.setPublicKey(publicKey[, encoding]) +### ecdh.setPublicKey(publicKey\[, encoding\]) <!-- YAML added: v0.11.14 deprecated: v5.2.0 @@ -1041,7 +1041,7 @@ console.log(hash.digest('hex')); // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 ``` -### hash.digest([encoding]) +### hash.digest(\[encoding\]) <!-- YAML added: v0.1.92 --> @@ -1057,7 +1057,7 @@ a [`Buffer`][] is returned. The `Hash` object can not be used again after `hash.digest()` method has been called. Multiple calls will cause an error to be thrown. -### hash.update(data[, inputEncoding]) +### hash.update(data\[, inputEncoding\]) <!-- YAML added: v0.1.92 changes: @@ -1139,7 +1139,7 @@ console.log(hmac.digest('hex')); // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e ``` -### hmac.digest([encoding]) +### hmac.digest(\[encoding\]) <!-- YAML added: v0.1.94 --> @@ -1154,7 +1154,7 @@ provided a string is returned; otherwise a [`Buffer`][] is returned; The `Hmac` object can not be used again after `hmac.digest()` has been called. Multiple calls to `hmac.digest()` will result in an error being thrown. -### hmac.update(data[, inputEncoding]) +### hmac.update(data\[, inputEncoding\]) <!-- YAML added: v0.1.94 changes: @@ -1229,7 +1229,7 @@ types are: This property is `undefined` for unrecognized `KeyObject` types and symmetric keys. -### keyObject.export([options]) +### keyObject.export(\[options\]) <!-- YAML added: v11.6.0 --> @@ -1354,7 +1354,7 @@ console.log(verify.verify(publicKey, signature)); // Prints: true ``` -### sign.sign(privateKey[, outputEncoding]) +### sign.sign(privateKey\[, outputEncoding\]) <!-- YAML added: v0.1.92 changes: @@ -1402,7 +1402,7 @@ is returned. The `Sign` object can not be again used after `sign.sign()` method has been called. Multiple calls to `sign.sign()` will result in an error being thrown. -### sign.update(data[, inputEncoding]) +### sign.update(data\[, inputEncoding\]) <!-- YAML added: v0.1.92 changes: @@ -1442,7 +1442,7 @@ The [`crypto.createVerify()`][] method is used to create `Verify` instances. See [`Sign`][] for examples. -### verify.update(data[, inputEncoding]) +### verify.update(data\[, inputEncoding\]) <!-- YAML added: v0.1.92 changes: @@ -1462,7 +1462,7 @@ encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][], `TypedArray`, or This can be called many times with new data as it is streamed. -### verify.verify(object, signature[, signatureEncoding]) +### verify.verify(object, signature\[, signatureEncoding\]) <!-- YAML added: v0.1.92 changes: @@ -1562,7 +1562,7 @@ is currently in use. Setting to true requires a FIPS build of Node.js. This property is deprecated. Please use `crypto.setFips()` and `crypto.getFips()` instead. -### crypto.createCipher(algorithm, password[, options]) +### crypto.createCipher(algorithm, password\[, options\]) <!-- YAML added: v0.1.94 deprecated: v10.0.0 @@ -1618,7 +1618,7 @@ they are used in order to avoid the risk of IV reuse that causes vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries][] for details. -### crypto.createCipheriv(algorithm, key, iv[, options]) +### crypto.createCipheriv(algorithm, key, iv\[, options\]) <!-- YAML added: v0.1.94 changes: @@ -1675,7 +1675,7 @@ something has to be unpredictable and unique, but does not have to be secret; it is important to remember that an attacker must not be able to predict ahead of time what a given IV will be. -### crypto.createDecipher(algorithm, password[, options]) +### crypto.createDecipher(algorithm, password\[, options\]) <!-- YAML added: v0.1.94 deprecated: v10.0.0 @@ -1712,7 +1712,7 @@ In line with OpenSSL's recommendation to use a more modern algorithm instead of their own using [`crypto.scrypt()`][] and to use [`crypto.createDecipheriv()`][] to create the `Decipher` object. -### crypto.createDecipheriv(algorithm, key, iv[, options]) +### crypto.createDecipheriv(algorithm, key, iv\[, options\]) <!-- YAML added: v0.1.94 changes: @@ -1769,7 +1769,7 @@ something has to be unpredictable and unique, but does not have to be secret; it is important to remember that an attacker must not be able to predict ahead of time what a given IV will be. -### crypto.createDiffieHellman(prime[, primeEncoding][, generator][, generatorEncoding]) +### crypto.createDiffieHellman(prime\[, primeEncoding\]\[, generator\]\[, generatorEncoding\]) <!-- YAML added: v0.11.12 changes: @@ -1804,7 +1804,7 @@ a [`Buffer`][], `TypedArray`, or `DataView` is expected. If `generatorEncoding` is specified, `generator` is expected to be a string; otherwise a number, [`Buffer`][], `TypedArray`, or `DataView` is expected. -### crypto.createDiffieHellman(primeLength[, generator]) +### crypto.createDiffieHellman(primeLength\[, generator\]) <!-- YAML added: v0.5.0 --> @@ -1842,7 +1842,7 @@ predefined curve specified by the `curveName` string. Use OpenSSL releases, `openssl ecparam -list_curves` will also display the name and description of each available elliptic curve. -### crypto.createHash(algorithm[, options]) +### crypto.createHash(algorithm\[, options\]) <!-- YAML added: v0.1.92 changes: @@ -1888,7 +1888,7 @@ input.on('readable', () => { }); ``` -### crypto.createHmac(algorithm, key[, options]) +### crypto.createHmac(algorithm, key\[, options\]) <!-- YAML added: v0.1.94 changes: @@ -2002,7 +2002,7 @@ added: v11.6.0 Creates and returns a new key object containing a secret key for symmetric encryption or `Hmac`. -### crypto.createSign(algorithm[, options]) +### crypto.createSign(algorithm\[, options\]) <!-- YAML added: v0.1.92 --> @@ -2021,7 +2021,7 @@ the corresponding digest algorithm. This does not work for all signature algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest algorithm names. -### crypto.createVerify(algorithm[, options]) +### crypto.createVerify(algorithm\[, options\]) <!-- YAML added: v0.1.92 --> @@ -2505,7 +2505,7 @@ object, the `padding` property can be passed. Otherwise, this function uses Because RSA public keys can be derived from private keys, a private key may be passed instead of a public key. -### crypto.randomBytes(size[, callback]) +### crypto.randomBytes(size\[, callback\]) <!-- YAML added: v0.5.8 changes: @@ -2564,7 +2564,7 @@ threadpool request. To minimize threadpool task length variation, partition large `randomBytes` requests when doing so as part of fulfilling a client request. -### crypto.randomFillSync(buffer[, offset][, size]) +### crypto.randomFillSync(buffer\[, offset\]\[, size\]) <!-- YAML added: - v7.10.0 @@ -2610,7 +2610,7 @@ console.log(Buffer.from(crypto.randomFillSync(c).buffer, c.byteOffset, c.byteLength).toString('hex')); ``` -### crypto.randomFill(buffer[, offset][, size], callback) +### crypto.randomFill(buffer\[, offset\]\[, size\], callback) <!-- YAML added: - v7.10.0 @@ -2685,7 +2685,7 @@ threadpool request. To minimize threadpool task length variation, partition large `randomFill` requests when doing so as part of fulfilling a client request. -### crypto.scrypt(password, salt, keylen[, options], callback) +### crypto.scrypt(password, salt, keylen\[, options\], callback) <!-- YAML added: v10.5.0 changes: @@ -2743,7 +2743,7 @@ crypto.scrypt('secret', 'salt', 64, { N: 1024 }, (err, derivedKey) => { }); ``` -### crypto.scryptSync(password, salt, keylen[, options]) +### crypto.scryptSync(password, salt, keylen\[, options\]) <!-- YAML added: v10.5.0 changes: @@ -2794,7 +2794,7 @@ const key2 = crypto.scryptSync('secret', 'salt', 64, { N: 1024 }); console.log(key2.toString('hex')); // '3745e48...aa39b34' ``` -### crypto.setEngine(engine[, flags]) +### crypto.setEngine(engine\[, flags\]) <!-- YAML added: v0.11.11 --> diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index eaaa5090f8..2509643728 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2003,7 +2003,7 @@ to be verified, no matter if it is set to true or not. Skipping the verification could lead to hard to find errors and crashes. <a id="DEP0103"></a> -### DEP0103: process.binding('util').is[...] typechecks +### DEP0103: process.binding('util').is\[...\] typechecks <!-- YAML changes: - version: v10.9.0 diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 7d8684f7f6..9efd14c89e 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -91,7 +91,7 @@ The event handler function is passed two arguments: `msg` and `rinfo`. * `port` {number} The sender port. * `size` {number} The message size. -### socket.addMembership(multicastAddress[, multicastInterface]) +### socket.addMembership(multicastAddress\[, multicastInterface\]) <!-- YAML added: v0.6.9 --> @@ -134,7 +134,7 @@ Returns an object containing the address information for a socket. For UDP sockets, this object will contain `address`, `family` and `port` properties. -### socket.bind([port][, address][, callback]) +### socket.bind(\[port\]\[, address\]\[, callback\]) <!-- YAML added: v0.1.99 changes: @@ -190,7 +190,7 @@ server.bind(41234); // Prints: server listening 0.0.0.0:41234 ``` -### socket.bind(options[, callback]) +### socket.bind(options\[, callback\]) <!-- YAML added: v0.11.14 --> @@ -243,7 +243,7 @@ socket.bind({ }); ``` -### socket.close([callback]) +### socket.close(\[callback\]) <!-- YAML added: v0.1.99 --> @@ -253,7 +253,7 @@ added: v0.1.99 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. -### socket.connect(port[, address][, callback]) +### socket.connect(port\[, address\]\[, callback\]) <!-- YAML added: v12.0.0 --> @@ -281,7 +281,7 @@ A synchronous function that disassociates a connected `dgram.Socket` from its remote address. Trying to call `disconnect()` on an already disconnected socket will result in an [`ERR_SOCKET_DGRAM_NOT_CONNECTED`][] exception. -### socket.dropMembership(multicastAddress[, multicastInterface]) +### socket.dropMembership(multicastAddress\[, multicastInterface\]) <!-- YAML added: v0.6.9 --> @@ -340,7 +340,7 @@ Returns an object containing the `address`, `family`, and `port` of the remote endpoint. It throws an [`ERR_SOCKET_DGRAM_NOT_CONNECTED`][] exception if the socket is not connected. -### socket.send(msg[, offset, length][, port][, address][, callback]) +### socket.send(msg\[, offset, length\]\[, port\]\[, address\]\[, callback\]) <!-- YAML added: v0.1.99 changes: @@ -648,7 +648,7 @@ chained. ## `dgram` module functions -### dgram.createSocket(options[, callback]) +### dgram.createSocket(options\[, callback\]) <!-- YAML added: v0.11.13 changes: @@ -687,7 +687,7 @@ method will bind the socket to the "all interfaces" address on a random port and port can be retrieved using [`socket.address().address`][] and [`socket.address().port`][]. -### dgram.createSocket(type[, callback]) +### dgram.createSocket(type\[, callback\]) <!-- YAML added: v0.1.99 --> diff --git a/doc/api/dns.md b/doc/api/dns.md index f7640dfb8e..34c6310519 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -128,7 +128,7 @@ section if a custom port is used. ] ``` -## dns.lookup(hostname[, options], callback) +## dns.lookup(hostname\[, options\], callback) <!-- YAML added: v0.1.90 changes: @@ -250,7 +250,7 @@ dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { If this method is invoked as its [`util.promisify()`][]ed version, it returns a `Promise` for an `Object` with `hostname` and `service` properties. -## dns.resolve(hostname[, rrtype], callback) +## dns.resolve(hostname\[, rrtype\], callback) <!-- YAML added: v0.1.27 --> @@ -283,7 +283,7 @@ records. The type and structure of individual results varies based on `rrtype`: On error, `err` is an [`Error`][] object, where `err.code` is one of the [DNS error codes](#dns_error_codes). -## dns.resolve4(hostname[, options], callback) +## dns.resolve4(hostname\[, options\], callback) <!-- YAML added: v0.1.16 changes: @@ -308,7 +308,7 @@ Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the will contain an array of IPv4 addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). -## dns.resolve6(hostname[, options], callback) +## dns.resolve6(hostname\[, options\], callback) <!-- YAML added: v0.1.16 changes: @@ -679,7 +679,7 @@ section if a custom port is used. ] ``` -### dnsPromises.lookup(hostname[, options]) +### dnsPromises.lookup(hostname\[, options\]) <!-- YAML added: v10.6.0 --> @@ -770,7 +770,7 @@ dnsPromises.lookupService('127.0.0.1', 22).then((result) => { }); ``` -### dnsPromises.resolve(hostname[, rrtype]) +### dnsPromises.resolve(hostname\[, rrtype\]) <!-- YAML added: v10.6.0 --> @@ -800,7 +800,7 @@ based on `rrtype`: On error, the `Promise` is rejected with an [`Error`][] object, where `err.code` is one of the [DNS error codes](#dns_error_codes). -### dnsPromises.resolve4(hostname[, options]) +### dnsPromises.resolve4(hostname\[, options\]) <!-- YAML added: v10.6.0 --> @@ -816,7 +816,7 @@ Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4 addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). -### dnsPromises.resolve6(hostname[, options]) +### dnsPromises.resolve6(hostname\[, options\]) <!-- YAML added: v10.6.0 --> diff --git a/doc/api/domain.md b/doc/api/domain.md index 4aae68cf40..d0ba5a446d 100644 --- a/doc/api/domain.md +++ b/doc/api/domain.md @@ -398,7 +398,7 @@ d.on('error', (er) => { The opposite of [`domain.add(emitter)`][]. Removes domain handling from the specified emitter. -### domain.run(fn[, ...args]) +### domain.run(fn\[, ...args\]) * `fn` {Function} * `...args` {any} diff --git a/doc/api/errors.md b/doc/api/errors.md index 8c86012630..97ca365125 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -201,7 +201,7 @@ are dependent on [V8's stack trace API][]. Stack traces extend only to either (a) the beginning of *synchronous code execution*, or (b) the number of frames given by the property `Error.stackTraceLimit`, whichever is smaller. -### Error.captureStackTrace(targetObject[, constructorOpt]) +### Error.captureStackTrace(targetObject\[, constructorOpt\]) * `targetObject` {Object} * `constructorOpt` {Function} diff --git a/doc/api/esm.md b/doc/api/esm.md index 951ce41819..e585ae4db6 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -910,14 +910,14 @@ _isMain_ is **true** when resolving the Node.js application entry point. > 1. If _exports_ is an Object, then > 1. Set _packagePath_ to _"./"_ concatenated with _packagePath_. > 1. If _packagePath_ is a key of _exports_, then -> 1. Let _target_ be the value of _exports[packagePath]_. +> 1. Let _target_ be the value of _exports\[packagePath\]_. > 1. Return **PACKAGE_EXPORTS_TARGET_RESOLVE**(_packageURL_, _target_, > _""_). > 1. Let _directoryKeys_ be the list of keys of _exports_ ending in > _"/"_, sorted by length descending. > 1. For each key _directory_ in _directoryKeys_, do > 1. If _packagePath_ starts with _directory_, then -> 1. Let _target_ be the value of _exports[directory]_. +> 1. Let _target_ be the value of _exports\[directory\]_. > 1. Let _subpath_ be the substring of _target_ starting at the index > of the length of _directory_. > 1. Return **PACKAGE_EXPORTS_TARGET_RESOLVE**(_packageURL_, _target_, diff --git a/doc/api/events.md b/doc/api/events.md index 608d7d09e0..5eeab1856b 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -295,7 +295,7 @@ added: v0.1.26 Alias for `emitter.on(eventName, listener)`. -### emitter.emit(eventName[, ...args]) +### emitter.emit(eventName\[, ...args\]) <!-- YAML added: v0.1.26 --> @@ -536,7 +536,7 @@ server.prependOnceListener('connection', (stream) => { Returns a reference to the `EventEmitter`, so that calls can be chained. -### emitter.removeAllListeners([eventName]) +### emitter.removeAllListeners(\[eventName\]) <!-- YAML added: v0.1.26 --> diff --git a/doc/api/fs.md b/doc/api/fs.md index d7a4ebcc2e..3d122b0e06 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1051,7 +1051,7 @@ added: v11.2.0 This property is `true` if the underlying file has not been opened yet, i.e. before the `'ready'` event is emitted. -## fs.access(path[, mode], callback) +## fs.access(path\[, mode\], callback) <!-- YAML added: v0.11.15 changes: @@ -1203,7 +1203,7 @@ a file or directory. The `fs.access()` function, however, does not check the ACL and therefore may report that a path is accessible even if the ACL restricts the user from reading or writing to it. -## fs.accessSync(path[, mode]) +## fs.accessSync(path\[, mode\]) <!-- YAML added: v0.11.15 changes: @@ -1235,7 +1235,7 @@ try { } ``` -## fs.appendFile(path, data[, options], callback) +## fs.appendFile(path, data\[, options\], callback) <!-- YAML added: v0.6.7 changes: @@ -1296,7 +1296,7 @@ fs.open('message.txt', 'a', (err, fd) => { }); ``` -## fs.appendFileSync(path, data[, options]) +## fs.appendFileSync(path, data\[, options\]) <!-- YAML added: v0.6.7 changes: @@ -1540,7 +1540,7 @@ Returns an object containing commonly used constants for file system operations. The specific constants currently defined are described in [FS Constants][]. -## fs.copyFile(src, dest[, flags], callback) +## fs.copyFile(src, dest\[, flags\], callback) <!-- YAML added: v8.5.0 --> @@ -1590,7 +1590,7 @@ const { COPYFILE_EXCL } = fs.constants; fs.copyFile('source.txt', 'destination.txt', COPYFILE_EXCL, callback); ``` -## fs.copyFileSync(src, dest[, flags]) +## fs.copyFileSync(src, dest\[, flags\]) <!-- YAML added: v8.5.0 --> @@ -1636,7 +1636,7 @@ const { COPYFILE_EXCL } = fs.constants; fs.copyFileSync('source.txt', 'destination.txt', COPYFILE_EXCL); ``` -## fs.createReadStream(path[, options]) +## fs.createReadStream(path\[, options\]) <!-- YAML added: v0.1.31 changes: @@ -1732,7 +1732,7 @@ fs.createReadStream('sample.txt', { start: 90, end: 99 }); If `options` is a string, then it specifies the encoding. -## fs.createWriteStream(path[, options]) +## fs.createWriteStream(path\[, options\]) <!-- YAML added: v0.1.31 changes: @@ -2024,7 +2024,7 @@ added: v0.1.96 Synchronous fdatasync(2). Returns `undefined`. -## fs.fstat(fd[, options], callback) +## fs.fstat(fd\[, options\], callback) <!-- YAML added: v0.1.95 changes: @@ -2054,7 +2054,7 @@ Asynchronous fstat(2). The callback gets two arguments `(err, stats)` where `stats` is an [`fs.Stats`][] object. `fstat()` is identical to [`stat()`][], except that the file to be stat-ed is specified by the file descriptor `fd`. -## fs.fstatSync(fd[, options]) +## fs.fstatSync(fd\[, options\]) <!-- YAML added: v0.1.95 changes: @@ -2102,7 +2102,7 @@ added: v0.1.96 Synchronous fsync(2). Returns `undefined`. -## fs.ftruncate(fd[, len], callback) +## fs.ftruncate(fd\[, len\], callback) <!-- YAML added: v0.8.6 changes: @@ -2166,7 +2166,7 @@ fs.ftruncate(fd, 10, (err) => { The last three bytes are null bytes (`'\0'`), to compensate the over-truncation. -## fs.ftruncateSync(fd[, len]) +## fs.ftruncateSync(fd\[, len\]) <!-- YAML added: v0.8.6 --> @@ -2341,7 +2341,7 @@ changes: Synchronous link(2). Returns `undefined`. -## fs.lstat(path[, options], callback) +## fs.lstat(path\[, options\], callback) <!-- YAML added: v0.1.30 changes: @@ -2376,7 +2376,7 @@ Asynchronous lstat(2). The callback gets two arguments `(err, stats)` where except that if `path` is a symbolic link, then the link itself is stat-ed, not the file that it refers to. -## fs.lstatSync(path[, options]) +## fs.lstatSync(path\[, options\]) <!-- YAML added: v0.1.30 changes: @@ -2398,7 +2398,7 @@ changes: Synchronous lstat(2). -## fs.mkdir(path[, options], callback) +## fs.mkdir(path\[, options\], callback) <!-- YAML added: v0.1.8 changes: @@ -2454,7 +2454,7 @@ fs.mkdir('/', { recursive: true }, (err) => { See also: mkdir(2). -## fs.mkdirSync(path[, options]) +## fs.mkdirSync(path\[, options\]) <!-- YAML added: v0.1.21 changes: @@ -2478,7 +2478,7 @@ This is the synchronous version of [`fs.mkdir()`][]. See also: mkdir(2). -## fs.mkdtemp(prefix[, options], callback) +## fs.mkdtemp(prefix\[, options\], callback) <!-- YAML added: v5.10.0 changes: @@ -2554,7 +2554,7 @@ fs.mkdtemp(`${tmpDir}${sep}`, (err, folder) => { }); ``` -## fs.mkdtempSync(prefix[, options]) +## fs.mkdtempSync(prefix\[, options\]) <!-- YAML added: v5.10.0 --> @@ -2572,7 +2572,7 @@ this API: [`fs.mkdtemp()`][]. The optional `options` argument can be a string specifying an encoding, or an object with an `encoding` property specifying the character encoding to use. -## fs.open(path[, flags[, mode]], callback) +## fs.open(path\[, flags\[, mode\]\], callback) <!-- YAML added: v0.0.2 changes: @@ -2612,7 +2612,7 @@ a colon, Node.js will open a file system stream, as described by Functions based on `fs.open()` exhibit this behavior as well: `fs.writeFile()`, `fs.readFile()`, etc. -## fs.openSync(path[, flags, mode]) +## fs.openSync(path\[, flags, mode\]) <!-- YAML added: v0.1.21 changes: @@ -2639,7 +2639,7 @@ Returns an integer representing the file descriptor. For detailed information, see the documentation of the asynchronous version of this API: [`fs.open()`][]. -## fs.opendir(path[, options], callback) +## fs.opendir(path\[, options\], callback) <!-- YAML added: REPLACEME --> @@ -2659,7 +2659,7 @@ and cleaning up the directory. The `encoding` option sets the encoding for the `path` while opening the directory and subsequent read operations. -## fs.opendirSync(path[, options]) +## fs.opendirSync(path\[, options\]) <!-- YAML added: REPLACEME --> @@ -2721,7 +2721,7 @@ The callback is given the three arguments, `(err, bytesRead, buffer)`. If this method is invoked as its [`util.promisify()`][]ed version, it returns a `Promise` for an `Object` with `bytesRead` and `buffer` properties. -## fs.readdir(path[, options], callback) +## fs.readdir(path\[, options\], callback) <!-- YAML added: v0.1.8 changes: @@ -2765,7 +2765,7 @@ the filenames returned will be passed as `Buffer` objects. If `options.withFileTypes` is set to `true`, the `files` array will contain [`fs.Dirent`][] objects. -## fs.readdirSync(path[, options]) +## fs.readdirSync(path\[, options\]) <!-- YAML added: v0.1.21 changes: @@ -2794,7 +2794,7 @@ the filenames returned will be passed as `Buffer` objects. If `options.withFileTypes` is set to `true`, the result will contain [`fs.Dirent`][] objects. -## fs.readFile(path[, options], callback) +## fs.readFile(path\[, options\], callback) <!-- YAML added: v0.1.29 changes: @@ -2877,7 +2877,7 @@ already had `'Hello World`' and six bytes are read with the file descriptor, the call to `fs.readFile()` with the same file descriptor, would give `'World'`, rather than `'Hello World'`. -## fs.readFileSync(path[, options]) +## fs.readFileSync(path\[, options\]) <!-- YAML added: v0.1.8 changes: @@ -2916,7 +2916,7 @@ fs.readFileSync('<directory>'); fs.readFileSync('<directory>'); // => <data> ``` -## fs.readlink(path[, options], callback) +## fs.readlink(path\[, options\], callback) <!-- YAML added: v0.1.31 changes: @@ -2949,7 +2949,7 @@ object with an `encoding` property specifying the character encoding to use for the link path passed to the callback. If the `encoding` is set to `'buffer'`, the link path returned will be passed as a `Buffer` object. -## fs.readlinkSync(path[, options]) +## fs.readlinkSync(path\[, options\]) <!-- YAML added: v0.1.31 changes: @@ -2996,7 +2996,7 @@ Returns the number of `bytesRead`. For detailed information, see the documentation of the asynchronous version of this API: [`fs.read()`][]. -## fs.realpath(path[, options], callback) +## fs.realpath(path\[, options\], callback) <!-- YAML added: v0.1.31 changes: @@ -3057,7 +3057,7 @@ the path returned will be passed as a `Buffer` object. If `path` resolves to a socket or a pipe, the function will return a system dependent name for that object. -## fs.realpath.native(path[, options], callback) +## fs.realpath.native(path\[, options\], callback) <!-- YAML added: v9.2.0 --> @@ -3084,7 +3084,7 @@ On Linux, when Node.js is linked against musl libc, the procfs file system must be mounted on `/proc` in order for this function to work. Glibc does not have this restriction. -## fs.realpathSync(path[, options]) +## fs.realpathSync(path\[, options\]) <!-- YAML added: v0.1.31 changes: @@ -3114,7 +3114,7 @@ Returns the resolved pathname. For detailed information, see the documentation of the asynchronous version of this API: [`fs.realpath()`][]. -## fs.realpathSync.native(path[, options]) +## fs.realpathSync.native(path\[, options\]) <!-- YAML added: v9.2.0 --> @@ -3192,7 +3192,7 @@ changes: Synchronous rename(2). Returns `undefined`. -## fs.rmdir(path[, options], callback) +## fs.rmdir(path\[, options\], callback) <!-- YAML added: v0.0.2 changes: @@ -3238,7 +3238,7 @@ to the completion callback. Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. -## fs.rmdirSync(path[, options]) +## fs.rmdirSync(path\[, options\]) <!-- YAML added: v0.1.21 changes: @@ -3265,7 +3265,7 @@ Synchronous rmdir(2). Returns `undefined`. Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. -## fs.stat(path[, options], callback) +## fs.stat(path\[, options\], callback) <!-- YAML added: v0.0.2 changes: @@ -3378,7 +3378,7 @@ Stats { } ``` -## fs.statSync(path[, options]) +## fs.statSync(path\[, options\]) <!-- YAML added: v0.1.21 changes: @@ -3400,7 +3400,7 @@ changes: Synchronous stat(2). -## fs.symlink(target, path[, type], callback) +## fs.symlink(target, path\[, type\], callback) <!-- YAML added: v0.1.31 changes: @@ -3448,7 +3448,7 @@ example/ └── mewtwo -> ./mew ``` -## fs.symlinkSync(target, path[, type]) +## fs.symlinkSync(target, path\[, type\]) <!-- YAML added: v0.1.31 changes: @@ -3472,7 +3472,7 @@ Returns `undefined`. For detailed information, see the documentation of the asynchronous version of this API: [`fs.symlink()`][]. -## fs.truncate(path[, len], callback) +## fs.truncate(path\[, len\], callback) <!-- YAML added: v0.8.6 changes: @@ -3498,7 +3498,7 @@ first argument. In this case, `fs.ftruncate()` is called. Passing a file descriptor is deprecated and may result in an error being thrown in the future. -## fs.truncateSync(path[, len]) +## fs.truncateSync(path\[, len\]) <!-- YAML added: v0.8.6 --> @@ -3564,7 +3564,7 @@ changes: Synchronous unlink(2). Returns `undefined`. -## fs.unwatchFile(filename[, listener]) +## fs.unwatchFile(filename\[, listener\]) <!-- YAML added: v0.1.31 --> @@ -3652,7 +3652,7 @@ Returns `undefined`. For detailed information, see the documentation of the asynchronous version of this API: [`fs.utimes()`][]. -## fs.watch(filename[, options][, listener]) +## fs.watch(filename\[, options\]\[, listener\]) <!-- YAML added: v0.5.10 changes: @@ -3764,7 +3764,7 @@ fs.watch('somedir', (eventType, filename) => { }); ``` -## fs.watchFile(filename[, options], listener) +## fs.watchFile(filename\[, options\], listener) <!-- YAML added: v0.1.31 changes: @@ -3826,7 +3826,7 @@ This happens when: * the file is deleted, followed by a restore * the file is renamed twice - the second time back to its original name -## fs.write(fd, buffer[, offset[, length[, position]]], callback) +## fs.write(fd, buffer\[, offset\[, length\[, position\]\]\], callback) <!-- YAML added: v0.0.2 changes: @@ -3883,7 +3883,7 @@ On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file. -## fs.write(fd, string[, position[, encoding]], callback) +## fs.write(fd, string\[, position\[, encoding\]\], callback) <!-- YAML added: v0.11.5 changes: @@ -3938,7 +3938,7 @@ It is possible to configure the console to render UTF-8 properly by changing the active codepage with the `chcp 65001` command. See the [chcp][] docs for more details. -## fs.writeFile(file, data[, options], callback) +## fs.writeFile(file, data\[, options\], callback) <!-- YAML added: v0.1.29 changes: @@ -4024,7 +4024,7 @@ on the size of the original file, and the position of the file descriptor). If a file name had been used instead of a descriptor, the file would be guaranteed to contain only `', World'`. -## fs.writeFileSync(file, data[, options]) +## fs.writeFileSync(file, data\[, options\]) <!-- YAML added: v0.1.29 changes: @@ -4052,7 +4052,7 @@ Returns `undefined`. For detailed information, see the documentation of the asynchronous version of this API: [`fs.writeFile()`][]. -## fs.writeSync(fd, buffer[, offset[, length[, position]]]) +## fs.writeSync(fd, buffer\[, offset\[, length\[, position\]\]\]) <!-- YAML added: v0.1.21 changes: @@ -4078,7 +4078,7 @@ changes: For detailed information, see the documentation of the asynchronous version of this API: [`fs.write(fd, buffer...)`][]. -## fs.writeSync(fd, string[, position[, encoding]]) +## fs.writeSync(fd, string\[, position\[, encoding\]\]) <!-- YAML added: v0.11.5 changes: @@ -4096,7 +4096,7 @@ changes: For detailed information, see the documentation of the asynchronous version of this API: [`fs.write(fd, string...)`][]. -## fs.writev(fd, buffers[, position], callback) +## fs.writev(fd, buffers\[, position\], callback) <!-- YAML added: v12.9.0 --> @@ -4129,7 +4129,7 @@ On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file. -## fs.writevSync(fd, buffers[, position]) +## fs.writevSync(fd, buffers\[, position\]) <!-- YAML added: v12.9.0 --> @@ -4315,7 +4315,7 @@ If one or more `filehandle.read()` calls are made on a file handle and then a position till the end of the file. It doesn't always read from the beginning of the file. -#### filehandle.stat([options]) +#### filehandle.stat(\[options\]) <!-- YAML added: v10.0.0 changes: @@ -4426,7 +4426,7 @@ then resolves the `Promise` with no arguments upon success. This function does not work on AIX versions before 7.1, it will resolve the `Promise` with an error using code `UV_ENOSYS`. -#### filehandle.write(buffer[, offset[, length[, position]]]) +#### filehandle.write(buffer\[, offset\[, length\[, position\]\]\]) <!-- YAML added: v10.0.0 --> @@ -4458,7 +4458,7 @@ On Linux, positional writes do not work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file. -#### filehandle.write(string[, position[, encoding]]) +#### filehandle.write(string\[, position\[, encoding\]\]) <!-- YAML added: v10.0.0 --> @@ -4519,7 +4519,7 @@ If one or more `filehandle.write()` calls are made on a file handle and then a current position till the end of the file. It doesn't always write from the beginning of the file. -#### filehandle.writev(buffers[, position]) +#### filehandle.writev(buffers\[, position\]) <!-- YAML added: v12.9.0 --> @@ -4545,7 +4545,7 @@ On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the position argument and always appends the data to the end of the file. -### fsPromises.access(path[, mode]) +### fsPromises.access(path\[, mode\]) <!-- YAML added: v10.0.0 --> @@ -4580,7 +4580,7 @@ condition, since other processes may change the file's state between the two calls. Instead, user code should open/read/write the file directly and handle the error raised if the file is not accessible. -### fsPromises.appendFile(path, data[, options]) +### fsPromises.appendFile(path, data\[, options\]) <!-- YAML added: v10.0.0 --> @@ -4627,7 +4627,7 @@ added: v10.0.0 Changes the ownership of a file then resolves the `Promise` with no arguments upon success. -### fsPromises.copyFile(src, dest[, flags]) +### fsPromises.copyFile(src, dest\[, flags\]) <!-- YAML added: v10.0.0 --> @@ -4720,7 +4720,7 @@ added: v10.0.0 Asynchronous link(2). The `Promise` is resolved with no arguments upon success. -### fsPromises.lstat(path[, options]) +### fsPromises.lstat(path\[, options\]) <!-- YAML added: v10.0.0 changes: @@ -4739,7 +4739,7 @@ changes: Asynchronous lstat(2). The `Promise` is resolved with the [`fs.Stats`][] object for the given symbolic link `path`. -### fsPromises.mkdir(path[, options]) +### fsPromises.mkdir(path\[, options\]) <!-- YAML added: v10.0.0 --> @@ -4759,7 +4759,7 @@ property indicating whether parent folders should be created. Calling `fsPromises.mkdir()` when `path` is a directory that exists results in a rejection only when `recursive` is false. -### fsPromises.mkdtemp(prefix[, options]) +### fsPromises.mkdtemp(prefix\[, options\]) <!-- YAML added: v10.0.0 --> @@ -4790,7 +4790,7 @@ characters directly to the `prefix` string. For instance, given a directory `prefix` must end with a trailing platform-specific path separator (`require('path').sep`). -### fsPromises.open(path, flags[, mode]) +### fsPromises.open(path, flags\[, mode\]) <!-- YAML added: v10.0.0 changes: @@ -4816,7 +4816,7 @@ by [Naming Files, Paths, and Namespaces][]. Under NTFS, if the filename contains a colon, Node.js will open a file system stream, as described by [this MSDN page][MSDN-Using-Streams]. -## fsPromises.opendir(path[, options]) +## fsPromises.opendir(path\[, options\]) <!-- YAML added: REPLACEME --> @@ -4848,7 +4848,7 @@ async function print(path) { print('./').catch(console.error); ``` -### fsPromises.readdir(path[, options]) +### fsPromises.readdir(path\[, options\]) <!-- YAML added: v10.0.0 changes: @@ -4874,7 +4874,7 @@ will be passed as `Buffer` objects. If `options.withFileTypes` is set to `true`, the resolved array will contain [`fs.Dirent`][] objects. -### fsPromises.readFile(path[, options]) +### fsPromises.readFile(path\[, options\]) <!-- YAML added: v10.0.0 --> @@ -4900,7 +4900,7 @@ returned. Any specified `FileHandle` has to support reading. -### fsPromises.readlink(path[, options]) +### fsPromises.readlink(path\[, options\]) <!-- YAML added: v10.0.0 --> @@ -4918,7 +4918,7 @@ object with an `encoding` property specifying the character encoding to use for the link path returned. If the `encoding` is set to `'buffer'`, the link path returned will be passed as a `Buffer` object. -### fsPromises.realpath(path[, options]) +### fsPromises.realpath(path\[, options\]) <!-- YAML added: v10.0.0 --> @@ -4955,7 +4955,7 @@ added: v10.0.0 Renames `oldPath` to `newPath` and resolves the `Promise` with no arguments upon success. -### fsPromises.rmdir(path[, options]) +### fsPromises.rmdir(path\[, options\]) <!-- YAML added: v10.0.0 changes: @@ -4989,7 +4989,7 @@ Using `fsPromises.rmdir()` on a file (not a directory) results in the `Promise` being rejected with an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX. -### fsPromises.stat(path[, options]) +### fsPromises.stat(path\[, options\]) <!-- YAML added: v10.0.0 changes: @@ -5007,7 +5007,7 @@ changes: The `Promise` is resolved with the [`fs.Stats`][] object for the given `path`. -### fsPromises.symlink(target, path[, type]) +### fsPromises.symlink(target, path\[, type\]) <!-- YAML added: v10.0.0 --> @@ -5025,7 +5025,7 @@ The `type` argument is only used on Windows platforms and can be one of `'dir'`, to be absolute. When using `'junction'`, the `target` argument will automatically be normalized to absolute path. -### fsPromises.truncate(path[, len]) +### fsPromises.truncate(path\[, len\]) <!-- YAML added: v10.0.0 --> @@ -5068,7 +5068,7 @@ The `atime` and `mtime` arguments follow these rules: * If the value can not be converted to a number, or is `NaN`, `Infinity` or `-Infinity`, an `Error` will be thrown. -### fsPromises.writeFile(file, data[, options]) +### fsPromises.writeFile(file, data\[, options\]) <!-- YAML added: v10.0.0 --> diff --git a/doc/api/globals.md b/doc/api/globals.md index 89592b98e1..a794cfb196 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -150,7 +150,7 @@ DataHandler.prototype.load = async function load(key) { This variable may appear to be global but is not. See [`require()`][]. -## setImmediate(callback[, ...args]) +## setImmediate(callback\[, ...args\]) <!-- YAML added: v0.9.1 --> @@ -159,7 +159,7 @@ added: v0.9.1 [`setImmediate`][] is described in the [timers][] section. -## setInterval(callback, delay[, ...args]) +## setInterval(callback, delay\[, ...args\]) <!-- YAML added: v0.0.1 --> @@ -168,7 +168,7 @@ added: v0.0.1 [`setInterval`][] is described in the [timers][] section. -## setTimeout(callback, delay[, ...args]) +## setTimeout(callback, delay\[, ...args\]) <!-- YAML added: v0.0.1 --> diff --git a/doc/api/http.md b/doc/api/http.md index 73de8c36b2..0d98c91b93 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -107,7 +107,7 @@ http.get({ }); ``` -### new Agent([options]) +### new Agent(\[options\]) <!-- YAML added: v0.3.4 --> @@ -149,7 +149,7 @@ options.agent = keepAliveAgent; http.request(options, onResponseCallback); ``` -### agent.createConnection(options[, callback]) +### agent.createConnection(options\[, callback\]) <!-- YAML added: v0.11.4 --> @@ -576,7 +576,7 @@ deprecated: REPLACEME See [`request.socket`][]. -### request.end([data[, encoding]][, callback]) +### request.end(\[data\[, encoding\]\]\[, callback\]) <!-- YAML added: v0.1.90 changes: @@ -701,7 +701,7 @@ or request.setHeader('Cookie', ['type=ninja', 'language=javascript']); ``` -### request.setNoDelay([noDelay]) +### request.setNoDelay(\[noDelay\]) <!-- YAML added: v0.5.9 --> @@ -711,7 +711,7 @@ added: v0.5.9 Once a socket is assigned to this request and is connected [`socket.setNoDelay()`][] will be called. -### request.setSocketKeepAlive([enable][, initialDelay]) +### request.setSocketKeepAlive(\[enable\]\[, initialDelay\]) <!-- YAML added: v0.5.9 --> @@ -722,7 +722,7 @@ added: v0.5.9 Once a socket is assigned to this request and is connected [`socket.setKeepAlive()`][] will be called. -### request.setTimeout(timeout[, callback]) +### request.setTimeout(timeout\[, callback\]) <!-- YAML added: v0.5.9 changes: @@ -787,7 +787,7 @@ added: v12.7.0 Is `true` if all data has been flushed to the underlying system, immediately before the [`'finish'`][] event is emitted. -### request.write(chunk[, encoding][, callback]) +### request.write(chunk\[, encoding\]\[, callback\]) <!-- YAML added: v0.1.29 --> @@ -994,7 +994,7 @@ After this event is emitted, the request's socket will not have a `'data'` event listener, meaning it will need to be bound in order to handle data sent to the server on that socket. -### server.close([callback]) +### server.close(\[callback\]) <!-- YAML added: v0.1.90 --> @@ -1044,7 +1044,7 @@ added: v0.7.0 Limits maximum incoming headers count. If set to 0, no limit will be applied. -### server.setTimeout([msecs][, callback]) +### server.setTimeout(\[msecs\]\[, callback\]) <!-- YAML added: v0.9.12 changes: @@ -1175,7 +1175,7 @@ deprecated: REPLACEME See [`response.socket`][]. -### response.end([data[, encoding]][, callback]) +### response.end(\[data\[, encoding\]\]\[, callback\]) <!-- YAML added: v0.1.90 changes: @@ -1383,7 +1383,7 @@ header will not yield the expected result. If progressive population of headers is desired with potential future retrieval and modification, use [`response.setHeader()`][] instead of [`response.writeHead()`][]. -### response.setTimeout(msecs[, callback]) +### response.setTimeout(msecs\[, callback\]) <!-- YAML added: v0.9.12 --> @@ -1481,7 +1481,7 @@ added: v12.7.0 Is `true` if all data has been flushed to the underlying system, immediately before the [`'finish'`][] event is emitted. -### response.write(chunk[, encoding][, callback]) +### response.write(chunk\[, encoding\]\[, callback\]) <!-- YAML added: v0.1.29 --> @@ -1527,7 +1527,7 @@ Sends a HTTP/1.1 100 Continue message to the client, indicating that the request body should be sent. See the [`'checkContinue'`][] event on `Server`. -### response.writeHead(statusCode[, statusMessage][, headers]) +### response.writeHead(statusCode\[, statusMessage\]\[, headers\]) <!-- YAML added: v0.1.30 changes: @@ -1672,7 +1672,7 @@ const req = http.request({ }); ``` -### message.destroy([error]) +### message.destroy(\[error\]) <!-- YAML added: v0.3.0 --> @@ -1778,7 +1778,7 @@ added: v0.11.6 The raw request/response trailer keys and values exactly as they were received. Only populated at the `'end'` event. -### message.setTimeout(msecs[, callback]) +### message.setTimeout(msecs\[, callback\]) <!-- YAML added: v0.5.9 --> @@ -1921,7 +1921,7 @@ A collection of all the standard HTTP response status codes, and the short description of each. For example, `http.STATUS_CODES[404] === 'Not Found'`. -## http.createServer([options][, requestListener]) +## http.createServer(\[options\]\[, requestListener\]) <!-- YAML added: v0.1.13 changes: @@ -1946,8 +1946,8 @@ Returns a new instance of [`http.Server`][]. The `requestListener` is a function which is automatically added to the [`'request'`][] event. -## http.get(options[, callback]) -## http.get(url[, options][, callback]) +## http.get(options\[, callback\]) +## http.get(url\[, options\]\[, callback\]) <!-- YAML added: v0.3.6 changes: @@ -2034,8 +2034,8 @@ added: v11.6.0 Read-only property specifying the maximum allowed size of HTTP headers in bytes. Defaults to 8KB. Configurable using the [`--max-http-header-size`][] CLI option. -## http.request(options[, callback]) -## http.request(url[, options][, callback]) +## http.request(options\[, callback\]) +## http.request(url\[, options\]\[, callback\]) <!-- YAML added: v0.3.6 changes: diff --git a/doc/api/http2.md b/doc/api/http2.md index 0582cdff21..c6938904c1 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -329,7 +329,7 @@ socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or will return the value of the connected `TLSSocket`'s own `alpnProtocol` property. -#### http2session.close([callback]) +#### http2session.close(\[callback\]) <!-- YAML added: v9.4.0 --> @@ -365,7 +365,7 @@ Will be `true` if this `Http2Session` instance is still connecting, will be set to `false` before emitting `connect` event and/or calling the `http2.connect` callback. -#### http2session.destroy([error][, code]) +#### http2session.destroy(\[error\]\[, code\]) <!-- YAML added: v8.4.0 --> @@ -408,7 +408,7 @@ connected, `true` if the `Http2Session` is connected with a `TLSSocket`, and `false` if the `Http2Session` is connected to any other kind of socket or stream. -#### http2session.goaway([code[, lastStreamID[, opaqueData]]]) +#### http2session.goaway(\[code\[, lastStreamID\[, opaqueData\]\]\]) <!-- YAML added: v9.4.0 --> @@ -456,7 +456,7 @@ a sent `SETTINGS` frame. Will be `true` after calling the `http2session.settings()` method. Will be `false` once all sent `SETTINGS` frames have been acknowledged. -#### http2session.ping([payload, ]callback) +#### http2session.ping(\[payload, \]callback) <!-- YAML added: v8.9.3 --> @@ -572,7 +572,7 @@ Provides miscellaneous information about the current state of the An object describing the current status of this `Http2Session`. -#### http2session.settings([settings][, callback]) +#### http2session.settings(\[settings\]\[, callback\]) <!-- YAML added: v8.4.0 --> @@ -795,7 +795,7 @@ client.on('origin', (origins) => { The `'origin'` event is only emitted when using a secure TLS connection. -#### clienthttp2session.request(headers[, options]) +#### clienthttp2session.request(headers\[, options\]) <!-- YAML added: v8.4.0 --> @@ -1032,7 +1032,7 @@ added: v11.2.0 This property shows the number of characters currently buffered to be written. See [`net.Socket.bufferSize`][] for details. -#### http2stream.close(code[, callback]) +#### http2stream.close(code\[, callback\]) <!-- YAML added: v8.4.0 --> @@ -1347,7 +1347,7 @@ client's most recent `SETTINGS` frame. Will be `true` if the remote peer accepts push streams, `false` otherwise. Settings are the same for every `Http2Stream` in the same `Http2Session`. -#### http2stream.pushStream(headers[, options], callback) +#### http2stream.pushStream(headers\[, options\], callback) <!-- YAML added: v8.4.0 --> @@ -1392,7 +1392,7 @@ a `weight` value to `http2stream.priority` with the `silent` option set to Calling `http2stream.pushStream()` from within a pushed stream is not permitted and will throw an error. -#### http2stream.respond([headers[, options]]) +#### http2stream.respond(\[headers\[, options\]\]) <!-- YAML added: v8.4.0 --> @@ -1435,7 +1435,7 @@ server.on('stream', (stream) => { }); ``` -#### http2stream.respondWithFD(fd[, headers[, options]]) +#### http2stream.respondWithFD(fd\[, headers\[, options\]\]) <!-- YAML added: v8.4.0 changes: @@ -1533,7 +1533,7 @@ server.on('stream', (stream) => { }); ``` -#### http2stream.respondWithFile(path[, headers[, options]]) +#### http2stream.respondWithFile(path\[, headers\[, options\]\]) <!-- YAML added: v8.4.0 changes: @@ -1751,7 +1751,7 @@ The `'timeout'` event is emitted when there is no activity on the Server for a given number of milliseconds set using `http2server.setTimeout()`. **Default:** 0 (no timeout) -#### server.close([callback]) +#### server.close(\[callback\]) <!-- YAML added: v8.4.0 --> @@ -1767,7 +1767,7 @@ If `callback` is provided, it is not invoked until all active sessions have been closed, although the server has already stopped allowing new sessions. See [`net.Server.close()`][] for more details. -#### server.setTimeout([msecs][, callback]) +#### server.setTimeout(\[msecs\]\[, callback\]) <!-- YAML added: v8.4.0 changes: @@ -1901,7 +1901,7 @@ negotiate an allowed protocol (i.e. HTTP/2 or HTTP/1.1). The event handler receives the socket for handling. If no listener is registered for this event, the connection is terminated. See the [Compatibility API][]. -#### server.close([callback]) +#### server.close(\[callback\]) <!-- YAML added: v8.4.0 --> @@ -1917,7 +1917,7 @@ If `callback` is provided, it is not invoked until all active sessions have been closed, although the server has already stopped allowing new sessions. See [`tls.Server.close()`][] for more details. -#### server.setTimeout([msecs][, callback]) +#### server.setTimeout(\[msecs\]\[, callback\]) <!-- YAML added: v8.4.0 --> @@ -1935,7 +1935,7 @@ The given callback is registered as a listener on the `'timeout'` event. In case of no callback function were assigned, a new `ERR_INVALID_CALLBACK` error will be thrown. -### http2.createServer(options[, onRequestHandler]) +### http2.createServer(options\[, onRequestHandler\]) <!-- YAML added: v8.4.0 changes: @@ -2049,7 +2049,7 @@ server.on('stream', (stream, headers) => { server.listen(80); ``` -### http2.createSecureServer(options[, onRequestHandler]) +### http2.createSecureServer(options\[, onRequestHandler\]) <!-- YAML added: v8.4.0 changes: @@ -2150,7 +2150,7 @@ server.on('stream', (stream, headers) => { server.listen(80); ``` -### http2.connect(authority[, options][, listener]) +### http2.connect(authority\[, options\]\[, listener\]) <!-- YAML added: v8.4.0 changes: @@ -2275,7 +2275,7 @@ Returns an object containing the default settings for an `Http2Session` instance. This method returns a new object instance every time it is called so instances returned may be safely modified for use. -### http2.getPackedSettings([settings]) +### http2.getPackedSettings(\[settings\]) <!-- YAML added: v8.4.0 --> @@ -2712,7 +2712,7 @@ deprecated: REPLACEME See [`request.socket`][]. -#### request.destroy([error]) +#### request.destroy(\[error\]) <!-- YAML added: v8.4.0 --> @@ -3013,7 +3013,7 @@ deprecated: REPLACEME See [`response.socket`][]. -#### response.end([data[, encoding]][, callback]) +#### response.end(\[data\[, encoding\]\]\[, callback\]) <!-- YAML added: v8.4.0 changes: @@ -3195,7 +3195,7 @@ const server = http2.createServer((req, res) => { }); ``` -#### response.setTimeout(msecs[, callback]) +#### response.setTimeout(msecs\[, callback\]) <!-- YAML added: v8.4.0 --> @@ -3294,7 +3294,7 @@ Is `true` after [`response.end()`][] has been called. This property does not indicate whether the data has been flushed, for this use [`writable.writableFinished`][] instead. -#### response.write(chunk[, encoding][, callback]) +#### response.write(chunk\[, encoding\]\[, callback\]) <!-- YAML added: v8.4.0 --> @@ -3341,7 +3341,7 @@ Sends a status `100 Continue` to the client, indicating that the request body should be sent. See the [`'checkContinue'`][] event on `Http2Server` and `Http2SecureServer`. -#### response.writeHead(statusCode[, statusMessage][, headers]) +#### response.writeHead(statusCode\[, statusMessage\]\[, headers\]) <!-- YAML added: v8.4.0 changes: diff --git a/doc/api/https.md b/doc/api/https.md index ee8776f9bd..0d8f859e9c 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -23,7 +23,7 @@ changes: An [`Agent`][] object for HTTPS similar to [`http.Agent`][]. See [`https.request()`][] for more information. -### new Agent([options]) +### new Agent(\[options\]) <!-- YAML changes: - version: v12.5.0 @@ -54,7 +54,7 @@ added: v0.3.4 See [`http.Server`][] for more information. -### server.close([callback]) +### server.close(\[callback\]) <!-- YAML added: v0.1.90 --> @@ -84,7 +84,7 @@ This method is identical to [`server.listen()`][] from [`net.Server`][]. See [`http.Server#maxHeadersCount`][]. -### server.setTimeout([msecs][, callback]) +### server.setTimeout(\[msecs\]\[, callback\]) <!-- YAML added: v0.11.2 --> @@ -113,7 +113,7 @@ added: v8.0.0 See [`http.Server#keepAliveTimeout`][]. -## https.createServer([options][, requestListener]) +## https.createServer(\[options\]\[, requestListener\]) <!-- YAML added: v0.3.4 --> @@ -156,8 +156,8 @@ https.createServer(options, (req, res) => { }).listen(8000); ``` -## https.get(options[, callback]) -## https.get(url[, options][, callback]) +## https.get(options\[, callback\]) +## https.get(url\[, options\]\[, callback\]) <!-- YAML added: v0.3.6 changes: @@ -204,8 +204,8 @@ added: v0.5.9 Global instance of [`https.Agent`][] for all HTTPS client requests. -## https.request(options[, callback]) -## https.request(url[, options][, callback]) +## https.request(options\[, callback\]) +## https.request(url\[, options\]\[, callback\]) <!-- YAML added: v0.3.6 changes: diff --git a/doc/api/inspector.md b/doc/api/inspector.md index 3205cce714..a5407cad33 100644 --- a/doc/api/inspector.md +++ b/doc/api/inspector.md @@ -27,7 +27,7 @@ require('inspector').console.log('a message'); The inspector console does not have API parity with Node.js console. -## inspector.open([port[, host[, wait]]]) +## inspector.open(\[port\[, host\[, wait\]\]\]) * `port` {number} Port to listen on for inspector connections. Optional. **Default:** what was specified on the CLI. @@ -141,7 +141,7 @@ with an error. [`session.connect()`][] will need to be called to be able to send messages again. Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. -### session.post(method[, params][, callback]) +### session.post(method\[, params\]\[, callback\]) <!-- YAML added: v8.0.0 --> diff --git a/doc/api/modules.md b/doc/api/modules.md index 29f7b32cd6..b862989ddf 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -695,7 +695,7 @@ Module { '/node_modules' ] } ``` -#### require.resolve(request[, options]) +#### require.resolve(request\[, options\]) <!-- YAML added: v0.3.0 changes: diff --git a/doc/api/net.md b/doc/api/net.md index 8da51f8dad..cd1b4f904e 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -64,7 +64,7 @@ added: v0.1.90 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()`]. @@ -142,7 +142,7 @@ server.listen(() => { Don't call `server.address()` until the `'listening'` event has been emitted. -### server.close([callback]) +### server.close(\[callback\]) <!-- YAML added: v0.1.90 --> @@ -234,7 +234,7 @@ server.on('error', (e) => { }); ``` -#### server.listen(handle[, backlog][, callback]) +#### server.listen(handle\[, backlog\]\[, callback\]) <!-- YAML added: v0.5.10 --> @@ -253,7 +253,7 @@ valid file descriptor. Listening on a file descriptor is not supported on Windows. -#### server.listen(options[, callback]) +#### server.listen(options\[, callback\]) <!-- YAML added: v0.11.14 changes: @@ -306,7 +306,7 @@ Starting an IPC server as root may cause the server path to be inaccessible for unprivileged users. Using `readableAll` and `writableAll` will make the server accessible for all users. -#### server.listen(path[, backlog][, callback]) +#### server.listen(path\[, backlog\]\[, callback\]) <!-- YAML added: v0.1.90 --> @@ -319,7 +319,7 @@ added: v0.1.90 Start an [IPC][] server listening for connections on the given `path`. -#### server.listen([port[, host[, backlog]]][, callback]) +#### server.listen(\[port\[, host\[, backlog\]\]\]\[, callback\]) <!-- YAML added: v0.1.90 --> @@ -406,7 +406,7 @@ is received. For example, it is passed to the listeners of a [`'connection'`][] event emitted on a [`net.Server`][], so the user can use it to interact with the client. -### new net.Socket([options]) +### new net.Socket(\[options\]) <!-- YAML added: v0.3.4 --> @@ -603,7 +603,7 @@ the error passed to the [`'error'`][] listener. The last parameter `connectListener`, if supplied, will be added as a listener for the [`'connect'`][] event **once**. -#### socket.connect(options[, connectListener]) +#### socket.connect(options\[, connectListener\]) <!-- YAML added: v0.1.90 changes: @@ -679,7 +679,7 @@ net.connect({ }); ``` -#### socket.connect(path[, connectListener]) +#### socket.connect(path\[, connectListener\]) * `path` {string} Path the client should connect to. See [Identifying paths for IPC connections][]. @@ -693,7 +693,7 @@ Alias to [`socket.connect(options[, connectListener])`][`socket.connect(options)`] called with `{ path: path }` as `options`. -#### socket.connect(port[, host][, connectListener]) +#### socket.connect(port\[, host\]\[, connectListener\]) <!-- YAML added: v0.1.90 --> @@ -725,7 +725,7 @@ that the [`socket.connect(options[, connectListener])`][`socket.connect(options)`] callback is a listener for the `'connect'` event. -### socket.destroy([exception]) +### socket.destroy(\[exception\]) <!-- YAML added: v0.1.90 --> @@ -744,7 +744,7 @@ listeners for that event will receive `exception` as an argument. * {boolean} Indicates if the connection is destroyed or not. Once a connection is destroyed no further data can be transferred using it. -### socket.end([data[, encoding]][, callback]) +### socket.end(\[data\[, encoding\]\]\[, callback\]) <!-- YAML added: v0.1.90 --> @@ -845,7 +845,7 @@ The numeric representation of the remote port. For example, `80` or `21`. Resumes reading after a call to [`socket.pause()`][]. -### socket.setEncoding([encoding]) +### socket.setEncoding(\[encoding\]) <!-- YAML added: v0.1.90 --> @@ -856,7 +856,7 @@ added: v0.1.90 Set the encoding for the socket as a [Readable Stream][]. See [`readable.setEncoding()`][] for more information. -### socket.setKeepAlive([enable][, initialDelay]) +### socket.setKeepAlive(\[enable\]\[, initialDelay\]) <!-- YAML added: v0.1.92 --> @@ -873,7 +873,7 @@ data packet received and the first keepalive probe. Setting `0` for `initialDelay` will leave the value unchanged from the default (or previous) setting. -### socket.setNoDelay([noDelay]) +### socket.setNoDelay(\[noDelay\]) <!-- YAML added: v0.1.90 --> @@ -885,7 +885,7 @@ Disables the Nagle algorithm. By default TCP connections use the Nagle algorithm, they buffer data before sending it off. Setting `true` for `noDelay` will immediately fire off data each time `socket.write()` is called. -### socket.setTimeout(timeout[, callback]) +### socket.setTimeout(timeout\[, callback\]) <!-- YAML added: v0.1.90 --> @@ -925,7 +925,7 @@ Calling `unref()` on a socket will allow the program to exit if this is the only active socket in the event system. If the socket is already `unref`ed calling `unref()` again will have no effect. -### socket.write(data[, encoding][, callback]) +### socket.write(data\[, encoding\]\[, callback\]) <!-- YAML added: v0.1.90 --> @@ -961,7 +961,7 @@ Possible signatures: * [`net.connect(port[, host][, connectListener])`][`net.connect(port, host)`] for TCP connections. -### net.connect(options[, connectListener]) +### net.connect(options\[, connectListener\]) <!-- YAML added: v0.7.0 --> @@ -973,7 +973,7 @@ added: v0.7.0 Alias to [`net.createConnection(options[, connectListener])`][`net.createConnection(options)`]. -### net.connect(path[, connectListener]) +### net.connect(path\[, connectListener\]) <!-- YAML added: v0.1.90 --> @@ -985,7 +985,7 @@ added: v0.1.90 Alias to [`net.createConnection(path[, connectListener])`][`net.createConnection(path)`]. -### net.connect(port[, host][, connectListener]) +### net.connect(port\[, host\]\[, connectListener\]) <!-- YAML added: v0.1.90 --> @@ -1018,7 +1018,7 @@ Possible signatures: The [`net.connect()`][] function is an alias to this function. -### net.createConnection(options[, connectListener]) +### net.createConnection(options\[, connectListener\]) <!-- YAML added: v0.1.90 --> @@ -1068,7 +1068,7 @@ changed to: const client = net.createConnection({ path: '/tmp/echo.sock' }); ``` -### net.createConnection(path[, connectListener]) +### net.createConnection(path\[, connectListener\]) <!-- YAML added: v0.1.90 --> @@ -1089,7 +1089,7 @@ immediately initiates connection with [`socket.connect(path[, connectListener])`][`socket.connect(path)`], then returns the `net.Socket` that starts the connection. -### net.createConnection(port[, host][, connectListener]) +### net.createConnection(port\[, host\]\[, connectListener\]) <!-- YAML added: v0.1.90 --> @@ -1112,7 +1112,7 @@ immediately initiates connection with [`socket.connect(port[, host][, connectListener])`][`socket.connect(port, host)`], then returns the `net.Socket` that starts the connection. -## net.createServer([options][, connectionListener]) +## net.createServer(\[options\]\[, connectionListener\]) <!-- YAML added: v0.5.0 --> diff --git a/doc/api/os.md b/doc/api/os.md index acd37e6a6f..6f22098f98 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -192,7 +192,7 @@ added: v0.3.3 The `os.freemem()` method returns the amount of free system memory in bytes as an integer. -## os.getPriority([pid]) +## os.getPriority(\[pid\]) <!-- YAML added: v10.10.0 --> @@ -361,7 +361,7 @@ On POSIX systems, the operating system release is determined by calling [uname(3)][]. On Windows, `GetVersionExW()` is used. Please see https://en.wikipedia.org/wiki/Uname#Examples for more information. -## os.setPriority([pid, ]priority) +## os.setPriority(\[pid, \]priority) <!-- YAML added: v10.10.0 --> @@ -438,7 +438,7 @@ changes: The `os.uptime()` method returns the system uptime in number of seconds. -## os.userInfo([options]) +## os.userInfo(\[options\]) <!-- YAML added: v6.0.0 --> diff --git a/doc/api/path.md b/doc/api/path.md index 8752eb5fdc..e752d7d688 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -60,7 +60,7 @@ example, `path.resolve('c:\\')` can potentially return a different result than `path.resolve('c:')`. For more information, see [this MSDN page][MSDN-Rel-Path]. -## path.basename(path[, ext]) +## path.basename(path\[, ext\]) <!-- YAML added: v0.1.25 changes: @@ -282,7 +282,7 @@ path.isAbsolute('.'); // false A [`TypeError`][] is thrown if `path` is not a string. -## path.join([...paths]) +## path.join(\[...paths\]) <!-- YAML added: v0.1.16 --> @@ -463,7 +463,7 @@ path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb'); A [`TypeError`][] is thrown if either `from` or `to` is not a string. -## path.resolve([...paths]) +## path.resolve(\[...paths\]) <!-- YAML added: v0.3.4 --> diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index d6ae1946c4..3fcdd99509 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -30,7 +30,7 @@ doSomeLongRunningProcess(() => { added: v8.5.0 --> -### performance.clearMarks([name]) +### performance.clearMarks(\[name\]) <!-- YAML added: v8.5.0 --> @@ -40,7 +40,7 @@ added: v8.5.0 If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. If `name` is provided, removes only the named mark. -### performance.mark([name]) +### performance.mark(\[name\]) <!-- YAML added: v8.5.0 --> @@ -384,7 +384,7 @@ added: v8.5.0 Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. -### performanceObserverEntryList.getEntriesByName(name[, type]) +### performanceObserverEntryList.getEntriesByName(name\[, type\]) <!-- YAML added: v8.5.0 --> @@ -410,7 +410,7 @@ Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`. -## perf_hooks.monitorEventLoopDelay([options]) +## perf_hooks.monitorEventLoopDelay(\[options\]) <!-- YAML added: v11.10.0 --> diff --git a/doc/api/process.md b/doc/api/process.md index 0ea80c6e33..eedbfeefdd 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -715,7 +715,7 @@ and [Cluster][] documentation), the `process.connected` property will return Once `process.connected` is `false`, it is no longer possible to send messages over the IPC channel using `process.send()`. -## process.cpuUsage([previousValue]) +## process.cpuUsage(\[previousValue\]) <!-- YAML added: v6.1.0 --> @@ -790,7 +790,7 @@ The effect of calling `process.disconnect()` is the same as calling If the Node.js process was not spawned with an IPC channel, `process.disconnect()` will be `undefined`. -## process.dlopen(module, filename[, flags]) +## process.dlopen(module, filename\[, flags\]) <!-- YAML added: v0.1.16 changes: @@ -832,7 +832,7 @@ process.dlopen(module, require.resolve('binding'), module.exports.foo(); ``` -## process.emitWarning(warning[, options]) +## process.emitWarning(warning\[, options\]) <!-- YAML added: v8.0.0 --> @@ -878,7 +878,7 @@ process.on('warning', (warning) => { If `warning` is passed as an `Error` object, the `options` argument is ignored. -## process.emitWarning(warning[, type[, code]][, ctor]) +## process.emitWarning(warning\[, type\[, code\]\]\[, ctor\]) <!-- YAML added: v6.0.0 --> @@ -1112,7 +1112,7 @@ that started the Node.js process. '/usr/local/bin/node' ``` -## process.exit([code]) +## process.exit(\[code\]) <!-- YAML added: v0.1.13 --> @@ -1292,7 +1292,7 @@ added: v9.3.0 Indicates whether a callback has been set using [`process.setUncaughtExceptionCaptureCallback()`][]. -## process.hrtime([time]) +## process.hrtime(\[time\]) <!-- YAML added: v0.7.6 --> @@ -1385,7 +1385,7 @@ This function is only available on POSIX platforms (i.e. not Windows or Android). This feature is not available in [`Worker`][] threads. -## process.kill(pid[, signal]) +## process.kill(pid\[, signal\]) <!-- YAML added: v0.0.6 --> @@ -1490,7 +1490,7 @@ _code segment_. When using [`Worker`][] threads, `rss` will be a value that is valid for the entire process, while the other fields will only refer to the current thread. -## process.nextTick(callback[, ...args]) +## process.nextTick(callback\[, ...args\]) <!-- YAML added: v0.1.26 changes: @@ -1749,7 +1749,7 @@ value is the empty string. console.log(`Report filename is ${process.report.filename}`); ``` -### process.report.getReport([err]) +### process.report.getReport(\[err\]) <!-- YAML added: v11.8.0 --> @@ -1837,7 +1837,7 @@ The signal used to trigger the creation of a diagnostic report. Defaults to console.log(`Report signal: ${process.report.signal}`); ``` -### process.report.writeReport([filename][, err]) +### process.report.writeReport(\[filename\]\[, err\]) <!-- YAML added: v11.8.0 --> @@ -1935,7 +1935,7 @@ console.log(process.resourceUsage()); */ ``` -## process.send(message[, sendHandle[, options]][, callback]) +## process.send(message\[, sendHandle\[, options\]\]\[, callback\]) <!-- YAML added: v0.5.9 --> @@ -2283,7 +2283,7 @@ documentation for the [`'warning'` event][process_warning] and the [`emitWarning()` method][process_emit_warning] for more information about this flag's behavior. -## process.umask([mask]) +## process.umask(\[mask\]) <!-- YAML added: v0.1.19 --> diff --git a/doc/api/querystring.md b/doc/api/querystring.md index 86885535af..383b162ee2 100644 --- a/doc/api/querystring.md +++ b/doc/api/querystring.md @@ -43,7 +43,7 @@ generally not expected to be used directly. It is exported primarily to allow application code to provide a replacement percent-encoding implementation if necessary by assigning `querystring.escape` to an alternative function. -## querystring.parse(str[, sep[, eq[, options]]]) +## querystring.parse(str\[, sep\[, eq\[, options\]\]\]) <!-- YAML added: v0.1.25 changes: @@ -99,7 +99,7 @@ querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, { decodeURIComponent: gbkDecodeURIComponent }); ``` -## querystring.stringify(obj[, sep[, eq[, options]]]) +## querystring.stringify(obj\[, sep\[, eq\[, options\]\]\]) <!-- YAML added: v0.1.25 --> diff --git a/doc/api/readline.md b/doc/api/readline.md index 03fdc44172..642272e401 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -212,7 +212,7 @@ later if necessary. Calling `rl.pause()` does not immediately pause other events (including `'line'`) from being emitted by the `readline.Interface` instance. -### rl.prompt([preserveCursor]) +### rl.prompt(\[preserveCursor\]) <!-- YAML added: v0.1.98 --> @@ -279,7 +279,7 @@ added: v0.1.98 The `rl.setPrompt()` method sets the prompt that will be written to `output` whenever `rl.prompt()` is called. -### rl.write(data[, key]) +### rl.write(data\[, key\]) <!-- YAML added: v0.1.98 --> @@ -349,7 +349,7 @@ async function processLineByLine() { } ``` -## readline.clearLine(stream, dir[, callback]) +## readline.clearLine(stream, dir\[, callback\]) <!-- YAML added: v0.7.7 changes: @@ -371,7 +371,7 @@ changes: The `readline.clearLine()` method clears current line of given [TTY][] stream in a specified direction identified by `dir`. -## readline.clearScreenDown(stream[, callback]) +## readline.clearScreenDown(stream\[, callback\]) <!-- YAML added: v0.7.7 changes: @@ -490,7 +490,7 @@ function completer(linePartial, callback) { } ``` -## readline.cursorTo(stream, x[, y][, callback]) +## readline.cursorTo(stream, x\[, y\]\[, callback\]) <!-- YAML added: v0.7.7 changes: @@ -510,7 +510,7 @@ changes: The `readline.cursorTo()` method moves cursor to the specified position in a given [TTY][] `stream`. -## readline.emitKeypressEvents(stream[, interface]) +## readline.emitKeypressEvents(stream\[, interface\]) <!-- YAML added: v0.7.7 --> @@ -536,7 +536,7 @@ if (process.stdin.isTTY) process.stdin.setRawMode(true); ``` -## readline.moveCursor(stream, dx, dy[, callback]) +## readline.moveCursor(stream, dx, dy\[, callback\]) <!-- YAML added: v0.7.7 changes: diff --git a/doc/api/repl.md b/doc/api/repl.md index d4a207dc49..81620e0e9b 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -446,7 +446,7 @@ Hello, Node.js User! Goodbye! ``` -### replServer.displayPrompt([preserveCursor]) +### replServer.displayPrompt(\[preserveCursor\]) <!-- YAML added: v0.1.91 --> @@ -476,7 +476,7 @@ buffered but not yet executed. This method is primarily intended to be called from within the action function for commands registered using the `replServer.defineCommand()` method. -### replServer.parseREPLKeyword(keyword[, rest]) +### replServer.parseREPLKeyword(keyword\[, rest\]) <!-- YAML added: v0.8.9 deprecated: v9.0.0 @@ -507,7 +507,7 @@ by default. However, this is not the case when creating a REPL programmatically. Use this method to initialize a history log file when working with REPL instances programmatically. -## repl.start([options]) +## repl.start(\[options\]) <!-- YAML added: v0.1.91 changes: diff --git a/doc/api/stream.md b/doc/api/stream.md index 36dac13853..52d8183d8d 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -366,7 +366,7 @@ buffered writes in a more optimized manner. See also: [`writable.uncork()`][]. -##### writable.destroy([error]) +##### writable.destroy(\[error\]) <!-- YAML added: v8.0.0 --> @@ -394,7 +394,7 @@ added: v8.0.0 Is `true` after [`writable.destroy()`][writable-destroy] has been called. -##### writable.end([chunk[, encoding]][, callback]) +##### writable.end(\[chunk\[, encoding\]\]\[, callback\]) <!-- YAML added: v0.9.4 changes: @@ -544,7 +544,7 @@ added: v12.3.0 Getter for the property `objectMode` of a given `Writable` stream. -##### writable.write(chunk[, encoding][, callback]) +##### writable.write(chunk\[, encoding\]\[, callback\]) <!-- YAML added: v0.9.4 changes: @@ -927,7 +927,7 @@ added: v0.9.4 The `'resume'` event is emitted when [`stream.resume()`][stream-resume] is called and `readableFlowing` is not `true`. -##### readable.destroy([error]) +##### readable.destroy(\[error\]) <!-- YAML added: v8.0.0 --> @@ -1000,7 +1000,7 @@ readable.on('data', (chunk) => { The `readable.pause()` method has no effect if there is a `'readable'` event listener. -##### readable.pipe(destination[, options]) +##### readable.pipe(destination\[, options\]) <!-- YAML added: v0.9.4 --> @@ -1062,7 +1062,7 @@ to prevent memory leaks. The [`process.stderr`][] and [`process.stdout`][] `Writable` streams are never closed until the Node.js process exits, regardless of the specified options. -##### readable.read([size]) +##### readable.read(\[size\]) <!-- YAML added: v0.9.4 --> @@ -1241,7 +1241,7 @@ readable.on('data', (chunk) => { }); ``` -##### readable.unpipe([destination]) +##### readable.unpipe(\[destination\]) <!-- YAML added: v0.9.4 --> @@ -1272,7 +1272,7 @@ setTimeout(() => { }, 1000); ``` -##### readable.unshift(chunk[, encoding]) +##### readable.unshift(chunk\[, encoding\]) <!-- YAML added: v0.9.11 changes: @@ -1451,7 +1451,7 @@ Examples of `Transform` streams include: * [zlib streams][zlib] * [crypto streams][crypto] -##### transform.destroy([error]) +##### transform.destroy(\[error\]) <!-- YAML added: v8.0.0 --> @@ -1465,7 +1465,7 @@ Implementors should not override this method, but instead implement The default implementation of `_destroy()` for `Transform` also emit `'close'` unless `emitClose` is set in false. -### stream.finished(stream[, options], callback) +### stream.finished(stream\[, options\], callback) <!-- YAML added: v10.0.0 --> @@ -1599,7 +1599,7 @@ run().catch(console.error); after the `callback` has been invoked. In the case of reuse of streams after failure, this can cause event listener leaks and swallowed errors. -### stream.Readable.from(iterable, [options]) +### stream.Readable.from(iterable, \[options\]) <!-- YAML added: v12.3.0 --> @@ -1706,7 +1706,7 @@ Custom `Writable` streams *must* call the `new stream.Writable([options])` constructor and implement the `writable._write()` and/or `writable._writev()` method. -#### Constructor: new stream.Writable([options]) +#### Constructor: new stream.Writable(\[options\]) <!-- YAML changes: - version: v10.0.0 @@ -1986,7 +1986,7 @@ The `stream.Readable` class is extended to implement a [`Readable`][] stream. Custom `Readable` streams *must* call the `new stream.Readable([options])` constructor and implement the `readable._read()` method. -#### new stream.Readable([options]) +#### new stream.Readable(\[options\]) <!-- YAML changes: - version: v11.2.0 @@ -2100,7 +2100,7 @@ added: v8.0.0 The `_destroy()` method is called by [`readable.destroy()`][readable-destroy]. It can be overridden by child classes but it **must not** be called directly. -#### readable.push(chunk[, encoding]) +#### readable.push(chunk\[, encoding\]) <!-- YAML changes: - version: v8.0.0 @@ -2412,7 +2412,7 @@ Care must be taken when using `Transform` streams in that data written to the stream can cause the `Writable` side of the stream to become paused if the output on the `Readable` side is not consumed. -#### new stream.Transform([options]) +#### new stream.Transform(\[options\]) * `options` {Object} Passed to both `Writable` and `Readable` constructors. Also has the following fields: diff --git a/doc/api/string_decoder.md b/doc/api/string_decoder.md index c2e5434ac7..525128bfa2 100644 --- a/doc/api/string_decoder.md +++ b/doc/api/string_decoder.md @@ -44,7 +44,7 @@ console.log(decoder.end(Buffer.from([0xAC]))); ## Class: StringDecoder -### new StringDecoder([encoding]) +### new StringDecoder(\[encoding\]) <!-- YAML added: v0.1.99 --> @@ -54,7 +54,7 @@ added: v0.1.99 Creates a new `StringDecoder` instance. -### stringDecoder.end([buffer]) +### stringDecoder.end(\[buffer\]) <!-- YAML added: v0.9.3 --> diff --git a/doc/api/timers.md b/doc/api/timers.md index a99dd1c41e..646c0abd1c 100644 --- a/doc/api/timers.md +++ b/doc/api/timers.md @@ -130,7 +130,7 @@ a certain period of time. When a timer's function is called varies depending on which method was used to create the timer and what other work the Node.js event loop is doing. -### setImmediate(callback[, ...args]) +### setImmediate(callback\[, ...args\]) <!-- YAML added: v0.9.1 --> @@ -172,7 +172,7 @@ async function timerExample() { timerExample(); ``` -### setInterval(callback, delay[, ...args]) +### setInterval(callback, delay\[, ...args\]) <!-- YAML added: v0.0.1 --> @@ -190,7 +190,7 @@ set to `1`. Non-integer delays are truncated to an integer. If `callback` is not a function, a [`TypeError`][] will be thrown. -### setTimeout(callback, delay[, ...args]) +### setTimeout(callback, delay\[, ...args\]) <!-- YAML added: v0.0.1 --> diff --git a/doc/api/tls.md b/doc/api/tls.md index f6a7f3a21e..5fe71e38c5 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -530,7 +530,7 @@ Returns the bound address, the address family name, and port of the server as reported by the operating system. See [`net.Server.address()`][] for more information. -### server.close([callback]) +### server.close(\[callback\]) <!-- YAML added: v0.3.2 --> @@ -614,7 +614,7 @@ Methods that return TLS connection metadata (e.g. [`tls.TLSSocket.getPeerCertificate()`][] will only return data while the connection is open. -### new tls.TLSSocket(socket[, options]) +### new tls.TLSSocket(socket\[, options\]) <!-- YAML added: v0.11.4 changes: @@ -875,7 +875,7 @@ provided by SSL/TLS is not desired or is not enough. Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used to implement the `tls-unique` channel binding from [RFC 5929][]. -### tlsSocket.getPeerCertificate([detailed]) +### tlsSocket.getPeerCertificate(\[detailed\]) <!-- YAML added: v0.11.4 --> @@ -1192,7 +1192,7 @@ the checks done with additional verification. This function is only called if the certificate passed all other checks, such as being issued by trusted CA (`options.ca`). -## tls.connect(options[, callback]) +## tls.connect(options\[, callback\]) <!-- YAML added: v0.11.3 changes: @@ -1322,7 +1322,7 @@ socket.on('end', () => { }); ``` -## tls.connect(path[, options][, callback]) +## tls.connect(path\[, options\]\[, callback\]) <!-- YAML added: v0.11.3 --> @@ -1337,7 +1337,7 @@ as an argument instead of an option. A path option, if specified, will take precedence over the path argument. -## tls.connect(port[, host][, options][, callback]) +## tls.connect(port\[, host\]\[, options\]\[, callback\]) <!-- YAML added: v0.11.3 --> @@ -1354,7 +1354,7 @@ as arguments instead of options. A port or host option, if specified, will take precedence over any port or host argument. -## tls.createSecureContext([options]) +## tls.createSecureContext(\[options\]) <!-- YAML added: v0.11.13 changes: @@ -1526,7 +1526,7 @@ A key is *required* for ciphers that make use of certificates. Either `key` or If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of CAs][]. -## tls.createServer([options][, secureConnectionListener]) +## tls.createServer(\[options\]\[, secureConnectionListener\]) <!-- YAML added: v0.3.2 changes: @@ -1742,7 +1742,7 @@ As with checking for the server event, `pair.cleartext.authorized` should be inspected to confirm whether the certificate used is properly authorized. -### tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options]) +### tls.createSecurePair(\[context\]\[, isServer\]\[, requestCert\]\[, rejectUnauthorized\]\[, options\]) <!-- YAML added: v0.3.2 deprecated: v0.11.3 diff --git a/doc/api/tty.md b/doc/api/tty.md index f2de746667..2f8e1de587 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -102,7 +102,7 @@ process.stdout.on('resize', () => { }); ``` -### writeStream.clearLine(dir[, callback]) +### writeStream.clearLine(dir\[, callback\]) <!-- YAML added: v0.7.7 changes: @@ -123,7 +123,7 @@ changes: `writeStream.clearLine()` clears the current line of this `WriteStream` in a direction identified by `dir`. -### writeStream.clearScreenDown([callback]) +### writeStream.clearScreenDown(\[callback\]) <!-- YAML added: v0.7.7 changes: @@ -148,7 +148,7 @@ added: v0.7.7 A `number` specifying the number of columns the TTY currently has. This property is updated whenever the `'resize'` event is emitted. -### writeStream.cursorTo(x[, y][, callback]) +### writeStream.cursorTo(x\[, y\]\[, callback\]) <!-- YAML added: v0.7.7 changes: @@ -167,7 +167,7 @@ changes: `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified position. -### writeStream.getColorDepth([env]) +### writeStream.getColorDepth(\[env\]) <!-- YAML added: v9.9.0 --> @@ -214,7 +214,7 @@ corresponding to this `WriteStream`. The array is of the type `[numColumns, numRows]` where `numColumns` and `numRows` represent the number of columns and rows in the corresponding [TTY](tty.html). -### writeStream.hasColors([count][, env]) +### writeStream.hasColors(\[count\]\[, env\]) <!-- YAML added: v11.13.0 --> @@ -250,7 +250,7 @@ added: v0.5.8 A `boolean` that is always `true`. -### writeStream.moveCursor(dx, dy[, callback]) +### writeStream.moveCursor(dx, dy\[, callback\]) <!-- YAML added: v0.7.7 changes: diff --git a/doc/api/url.md b/doc/api/url.md index 3583d31074..d50061abe1 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -89,7 +89,7 @@ using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still return `true`. -#### Constructor: new URL(input[, base]) +#### Constructor: new URL(input\[, base\]) * `input` {string} The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` @@ -706,7 +706,7 @@ is the `name`, the second item of the `Array` is the `value`. Alias for [`urlSearchParams[@@iterator]()`][`urlSearchParams@@iterator()`]. -#### urlSearchParams.forEach(fn[, thisArg]) +#### urlSearchParams.forEach(fn\[, thisArg\]) * `fn` {Function} Invoked for each name-value pair in the query * `thisArg` {Object} To be used as `this` value for when `fn` is called @@ -915,7 +915,7 @@ new URL('file:///hello world').pathname; // Incorrect: /hello%20world fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) ``` -### url.format(URL[, options]) +### url.format(URL\[, options\]) <!-- YAML added: v7.6.0 --> @@ -1181,7 +1181,7 @@ The formatting process operates as follows: string, an [`Error`][] is thrown. * `result` is returned. -### url.parse(urlString[, parseQueryString[, slashesDenoteHost]]) +### url.parse(urlString\[, parseQueryString\[, slashesDenoteHost\]\]) <!-- YAML added: v0.1.25 changes: diff --git a/doc/api/util.md b/doc/api/util.md index ace167fb43..0648c22c0f 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -119,7 +119,7 @@ FOO-BAR 3257: hi there, it's foo-bar [2333] Multiple comma-separated `section` names may be specified in the `NODE_DEBUG` environment variable: `NODE_DEBUG=fs,net,tls`. -## util.deprecate(fn, msg[, code]) +## util.deprecate(fn, msg\[, code\]) <!-- YAML added: v0.8.0 changes: @@ -181,7 +181,7 @@ The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation` and `process.traceDeprecation`. -## util.format(format[, ...args]) +## util.format(format\[, ...args\]) <!-- YAML added: v0.5.3 changes: @@ -287,7 +287,7 @@ util.format('%% %s'); Some input values can have a significant performance overhead that can block the event loop. Use this function with care and never in a hot code path. -## util.formatWithOptions(inspectOptions, format[, ...args]) +## util.formatWithOptions(inspectOptions, format\[, ...args\]) <!-- YAML added: v10.0.0 --> @@ -393,8 +393,8 @@ stream.on('data', (data) => { stream.write('With ES6'); ``` -## util.inspect(object[, options]) -## util.inspect(object[, showHidden[, depth[, colors]]]) +## util.inspect(object\[, options\]) +## util.inspect(object\[, showHidden\[, depth\[, colors\]\]\]) <!-- YAML added: v0.3.0 changes: @@ -991,7 +991,7 @@ Different Node.js build configurations support different sets of encodings. The `'iso-8859-16'` encoding listed in the [WHATWG Encoding Standard][] is not supported. -### new TextDecoder([encoding[, options]]) +### new TextDecoder(\[encoding\[, options\]\]) <!-- YAML added: v8.3.0 changes: @@ -1016,7 +1016,7 @@ supported encodings or an alias. The `TextDecoder` class is also available on the global object. -### textDecoder.decode([input[, options]]) +### textDecoder.decode(\[input\[, options\]\]) * `input` {ArrayBuffer|DataView|TypedArray} An `ArrayBuffer`, `DataView` or `TypedArray` instance containing the encoded data. @@ -1071,7 +1071,7 @@ const uint8array = encoder.encode('this is some data'); The `TextEncoder` class is also available on the global object. -### textEncoder.encode([input]) +### textEncoder.encode(\[input\]) * `input` {string} The text to encode. **Default:** an empty string. * Returns: {Uint8Array} diff --git a/doc/api/v8.md b/doc/api/v8.md index 82d29712d5..459df5597b 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -212,7 +212,7 @@ v8.setFlagsFromString('--trace_gc'); setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); ``` -## v8.writeHeapSnapshot([filename]) +## v8.writeHeapSnapshot(\[filename\]) <!-- YAML added: v11.13.0 --> diff --git a/doc/api/vm.md b/doc/api/vm.md index 601b8c3052..cc244f6694 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -51,7 +51,7 @@ added: v0.3.1 Instances of the `vm.Script` class contain precompiled scripts that can be executed in specific sandboxes (or "contexts"). -### Constructor: new vm.Script(code[, options]) +### Constructor: new vm.Script(code\[, options\]) <!-- YAML added: v0.3.1 changes: @@ -130,7 +130,7 @@ script.runInThisContext(); const cacheWithX = script.createCachedData(); ``` -### script.runInContext(contextifiedSandbox[, options]) +### script.runInContext(contextifiedSandbox\[, options\]) <!-- YAML added: v0.3.1 changes: @@ -188,7 +188,7 @@ Using the `timeout` or `breakOnSigint` options will result in new event loops and corresponding threads being started, which have a non-zero performance overhead. -### script.runInNewContext([sandbox[, options]]) +### script.runInNewContext(\[sandbox\[, options\]\]) <!-- YAML added: v0.3.1 changes: @@ -255,7 +255,7 @@ console.log(util.inspect(sandboxes)); // [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] ``` -### script.runInThisContext([options]) +### script.runInThisContext(\[options\]) <!-- YAML added: v0.3.1 changes: @@ -404,7 +404,7 @@ const contextifiedSandbox = vm.createContext({ secret: 42 }); })(); ``` -### Constructor: new vm.SourceTextModule(code[, options]) +### Constructor: new vm.SourceTextModule(code\[, options\]) * `code` {string} JavaScript Module code to parse * `options` @@ -492,7 +492,7 @@ exception due to possible ambiguity with `throw undefined;`. Corresponds to the `[[EvaluationError]]` field of [Source Text Module Record][]s in the ECMAScript specification. -### module.evaluate([options]) +### module.evaluate(\[options\]) * `options` {Object} * `timeout` {integer} Specifies the number of milliseconds to evaluate @@ -613,7 +613,7 @@ value that is not `undefined`. The identifier of the current module, as set in the constructor. -## vm.compileFunction(code[, params[, options]]) +## vm.compileFunction(code\[, params\[, options\]\]) <!-- YAML added: v10.10.0 --> @@ -644,7 +644,7 @@ Compiles the given code into the provided context/sandbox (if no context is supplied, the current context is used), and returns it wrapped inside a function with the given `params`. -## vm.createContext([sandbox[, options]]) +## vm.createContext(\[sandbox\[, options\]\]) <!-- YAML added: v0.3.1 changes: @@ -722,7 +722,7 @@ added: v0.11.7 Returns `true` if the given `sandbox` object has been [contextified][] using [`vm.createContext()`][]. -## vm.runInContext(code, contextifiedSandbox[, options]) +## vm.runInContext(code, contextifiedSandbox\[, options\]) <!-- YAML added: v0.3.1 changes: @@ -802,7 +802,7 @@ console.log(util.inspect(sandbox)); // { globalVar: 1024 } ``` -## vm.runInNewContext(code[, sandbox[, options]]) +## vm.runInNewContext(code\[, sandbox\[, options\]\]) <!-- YAML added: v0.3.1 changes: @@ -900,7 +900,7 @@ console.log(util.inspect(sandbox)); // { animal: 'cat', count: 3, name: 'kitty' } ``` -## vm.runInThisContext(code[, options]) +## vm.runInThisContext(code\[, options\]) <!-- YAML added: v0.3.1 changes: diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 023d41db29..b5b7499637 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -290,7 +290,7 @@ This method can be called when no further communication will happen over this The [`'close'` event][] will be emitted on both `MessagePort` instances that are part of the channel. -### port.postMessage(value[, transferList]) +### port.postMessage(value\[, transferList\]) <!-- YAML added: v10.5.0 --> @@ -487,7 +487,7 @@ if (isMainThread) { } ``` -### new Worker(filename[, options]) +### new Worker(filename\[, options\]) * `filename` {string} The path to the Worker’s main script. Must be either an absolute path or a relative path (i.e. relative to the @@ -561,7 +561,7 @@ added: v10.5.0 The `'online'` event is emitted when the worker thread has started executing JavaScript code. -### worker.postMessage(value[, transferList]) +### worker.postMessage(value\[, transferList\]) <!-- YAML added: v10.5.0 --> diff --git a/doc/api/zlib.md b/doc/api/zlib.md index de57a561c3..76e1a31974 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -572,7 +572,7 @@ The `zlib.bytesWritten` property specifies the number of bytes written to the engine, before the bytes are processed (compressed or decompressed, as appropriate for the derived class). -### zlib.close([callback]) +### zlib.close(\[callback\]) <!-- YAML added: v0.9.4 --> @@ -581,7 +581,7 @@ added: v0.9.4 Close the underlying handle. -### zlib.flush([kind, ]callback) +### zlib.flush(\[kind, \]callback) <!-- YAML added: v0.5.8 --> @@ -627,7 +627,7 @@ added: v7.0.0 Provides an object enumerating Zlib-related constants. -## zlib.createBrotliCompress([options]) +## zlib.createBrotliCompress(\[options\]) <!-- YAML added: v11.7.0 --> @@ -636,7 +636,7 @@ added: v11.7.0 Creates and returns a new [`BrotliCompress`][] object. -## zlib.createBrotliDecompress([options]) +## zlib.createBrotliDecompress(\[options\]) <!-- YAML added: v11.7.0 --> @@ -645,7 +645,7 @@ added: v11.7.0 Creates and returns a new [`BrotliDecompress`][] object. -## zlib.createDeflate([options]) +## zlib.createDeflate(\[options\]) <!-- YAML added: v0.5.8 --> @@ -654,7 +654,7 @@ added: v0.5.8 Creates and returns a new [`Deflate`][] object. -## zlib.createDeflateRaw([options]) +## zlib.createDeflateRaw(\[options\]) <!-- YAML added: v0.5.8 --> @@ -670,7 +670,7 @@ so Node.js restored the original behavior of upgrading a value of 8 to 9, since passing `windowBits = 9` to zlib actually results in a compressed stream that effectively uses an 8-bit window only. -## zlib.createGunzip([options]) +## zlib.createGunzip(\[options\]) <!-- YAML added: v0.5.8 --> @@ -679,7 +679,7 @@ added: v0.5.8 Creates and returns a new [`Gunzip`][] object. -## zlib.createGzip([options]) +## zlib.createGzip(\[options\]) <!-- YAML added: v0.5.8 --> @@ -689,7 +689,7 @@ added: v0.5.8 Creates and returns a new [`Gzip`][] object. See [example][zlib.createGzip example]. -## zlib.createInflate([options]) +## zlib.createInflate(\[options\]) <!-- YAML added: v0.5.8 --> @@ -698,7 +698,7 @@ added: v0.5.8 Creates and returns a new [`Inflate`][] object. -## zlib.createInflateRaw([options]) +## zlib.createInflateRaw(\[options\]) <!-- YAML added: v0.5.8 --> @@ -707,7 +707,7 @@ added: v0.5.8 Creates and returns a new [`InflateRaw`][] object. -## zlib.createUnzip([options]) +## zlib.createUnzip(\[options\]) <!-- YAML added: v0.5.8 --> @@ -728,7 +728,7 @@ with `callback(error, result)`. Every method has a `*Sync` counterpart, which accept the same arguments, but without a callback. -### zlib.brotliCompress(buffer[, options], callback) +### zlib.brotliCompress(buffer\[, options\], callback) <!-- YAML added: v11.7.0 --> @@ -737,7 +737,7 @@ added: v11.7.0 * `options` {brotli options} * `callback` {Function} -### zlib.brotliCompressSync(buffer[, options]) +### zlib.brotliCompressSync(buffer\[, options\]) <!-- YAML added: v11.7.0 --> @@ -747,7 +747,7 @@ added: v11.7.0 Compress a chunk of data with [`BrotliCompress`][]. -### zlib.brotliDecompress(buffer[, options], callback) +### zlib.brotliDecompress(buffer\[, options\], callback) <!-- YAML added: v11.7.0 --> @@ -756,7 +756,7 @@ added: v11.7.0 * `options` {brotli options} * `callback` {Function} -### zlib.brotliDecompressSync(buffer[, options]) +### zlib.brotliDecompressSync(buffer\[, options\]) <!-- YAML added: v11.7.0 --> @@ -766,7 +766,7 @@ added: v11.7.0 Decompress a chunk of data with [`BrotliDecompress`][]. -### zlib.deflate(buffer[, options], callback) +### zlib.deflate(buffer\[, options\], callback) <!-- YAML added: v0.6.0 changes: @@ -785,7 +785,7 @@ changes: * `options` {zlib options} * `callback` {Function} -### zlib.deflateSync(buffer[, options]) +### zlib.deflateSync(buffer\[, options\]) <!-- YAML added: v0.11.12 changes: @@ -805,7 +805,7 @@ changes: Compress a chunk of data with [`Deflate`][]. -### zlib.deflateRaw(buffer[, options], callback) +### zlib.deflateRaw(buffer\[, options\], callback) <!-- YAML added: v0.6.0 changes: @@ -821,7 +821,7 @@ changes: * `options` {zlib options} * `callback` {Function} -### zlib.deflateRawSync(buffer[, options]) +### zlib.deflateRawSync(buffer\[, options\]) <!-- YAML added: v0.11.12 changes: @@ -841,7 +841,7 @@ changes: Compress a chunk of data with [`DeflateRaw`][]. -### zlib.gunzip(buffer[, options], callback) +### zlib.gunzip(buffer\[, options\], callback) <!-- YAML added: v0.6.0 changes: @@ -860,7 +860,7 @@ changes: * `options` {zlib options} * `callback` {Function} -### zlib.gunzipSync(buffer[, options]) +### zlib.gunzipSync(buffer\[, options\]) <!-- YAML added: v0.11.12 changes: @@ -880,7 +880,7 @@ changes: Decompress a chunk of data with [`Gunzip`][]. -### zlib.gzip(buffer[, options], callback) +### zlib.gzip(buffer\[, options\], callback) <!-- YAML added: v0.6.0 changes: @@ -899,7 +899,7 @@ changes: * `options` {zlib options} * `callback` {Function} -### zlib.gzipSync(buffer[, options]) +### zlib.gzipSync(buffer\[, options\]) <!-- YAML added: v0.11.12 changes: @@ -919,7 +919,7 @@ changes: Compress a chunk of data with [`Gzip`][]. -### zlib.inflate(buffer[, options], callback) +### zlib.inflate(buffer\[, options\], callback) <!-- YAML added: v0.6.0 changes: @@ -938,7 +938,7 @@ changes: * `options` {zlib options} * `callback` {Function} -### zlib.inflateSync(buffer[, options]) +### zlib.inflateSync(buffer\[, options\]) <!-- YAML added: v0.11.12 changes: @@ -958,7 +958,7 @@ changes: Decompress a chunk of data with [`Inflate`][]. -### zlib.inflateRaw(buffer[, options], callback) +### zlib.inflateRaw(buffer\[, options\], callback) <!-- YAML added: v0.6.0 changes: @@ -977,7 +977,7 @@ changes: * `options` {zlib options} * `callback` {Function} -### zlib.inflateRawSync(buffer[, options]) +### zlib.inflateRawSync(buffer\[, options\]) <!-- YAML added: v0.11.12 changes: @@ -997,7 +997,7 @@ changes: Decompress a chunk of data with [`InflateRaw`][]. -### zlib.unzip(buffer[, options], callback) +### zlib.unzip(buffer\[, options\], callback) <!-- YAML added: v0.6.0 changes: @@ -1016,7 +1016,7 @@ changes: * `options` {zlib options} * `callback` {Function} -### zlib.unzipSync(buffer[, options]) +### zlib.unzipSync(buffer\[, options\]) <!-- YAML added: v0.11.12 changes: diff --git a/doc/changelogs/CHANGELOG_ARCHIVE.md b/doc/changelogs/CHANGELOG_ARCHIVE.md index 938f71abdb..cce728d717 100644 --- a/doc/changelogs/CHANGELOG_ARCHIVE.md +++ b/doc/changelogs/CHANGELOG_ARCHIVE.md @@ -340,7 +340,7 @@ https://github.com/nodejs/node/commit/b46e77421581ea358e221a8a843d057c747f7e90 * crypto: add newline to cert and key if not present (Fedor Indutny) * crypto: clear error in GetPeerCertificate (Fedor Indutny) * crypto: honor default ciphers in client mode (Jacob Hoffman-Andrews) -* crypto: introduce .setEngine(engine, [flags]) (Fedor Indutny) +* crypto: introduce .setEngine(engine, \[flags\]) (Fedor Indutny) * crypto: support custom pbkdf2 digest methods (Ben Noordhuis) * domain: fix off-by-one in Domain.exit() (Ryan Graham) * http: concatenate duplicate headers by default (Alex Kocharin) @@ -614,7 +614,7 @@ https://github.com/nodejs/node/commit/bce38b3d74e64fcb7d04a2dd551151da6168cdc5 * os: use %SystemRoot% or %windir% in os.tmpdir() (Suwon Chae) * util: fix util.inspect() line width calculation (Marcin Kostrzewa) * buffer: remove _charsWritten (Trevor Norris) -* fs: uv_[fl]stat now reports subsecond resolution (Timothy J Fontaine) +* fs: uv_\[fl\]stat now reports subsecond resolution (Timothy J Fontaine) * fs: Throw if error raised and missing callback (bnoordhuis) * tls: expose SSL_CTX_set_timeout via tls.createServer (Manav Rathi) * tls: remove harmful unnecessary bounds checking (Marcel Laverdet) @@ -1184,7 +1184,7 @@ https://github.com/nodejs/node/commit/0544a586ca6b6b900a42e164033dbf350765700a * npm: Upgrade to v1.1.48 * Add 'make binary' to build binary tarballs for all Unixes (Nathan Rajlich) * zlib: Emit 'close' on destroy(). (Dominic Tarr) -* child_process: Fix stdout=null when stdio=['pipe'] (Tyler Neylon) +* child_process: Fix stdout=null when stdio=\['pipe'\] (Tyler Neylon) * installer: prevent ETXTBSY errors (Ben Noordhuis) * installer: honor --without-npm, default install path (Ben Noordhuis) * net: make pause work with connecting sockets (Bert Belder) @@ -3327,7 +3327,7 @@ https://github.com/nodejs/node/commit/a2d809fe902f6c4102dba8f2e3e9551aad137c0f * Bugfix: posix.statSync() was crashing * Statically define string symbols for performance improvement -* Bugfix: ARGV[0] weirdness +* Bugfix: ARGV\[0\] weirdness * Added superCtor to ctor.super_ instead superCtor.prototype. (Johan Dahlberg) |