diff --git a/BUILDING.md b/BUILDING.md index eda74fb70f41bc..697d4bd63aa107 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -34,8 +34,8 @@ Support is divided into three tiers: ### Supported platforms The community does not build or test against end-of-life distributions (EoL). -Thus we do not recommend that you use Node on end-of-life or unsupported platforms -in production. +Thus we do not recommend that you use Node on end-of-life or unsupported +platforms in production. | System | Support type | Version | Architectures | Notes | |--------------|--------------|----------------------------------|----------------------|------------------| @@ -108,9 +108,11 @@ installed, you can find them under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`. This step will install `clang`, `clang++`, and `make`. * After building, you may want to setup [firewall rules](tools/macosx-firewall.sh) -to avoid popups asking to accept incoming network connections when running tests: +to avoid popups asking to accept incoming network connections when running +tests: -If the path to your build directory contains a space, the build will likely fail. +If the path to your build directory contains a space, the build will likely +fail. ```console $ sudo ./tools/macosx-firewall.sh @@ -233,8 +235,8 @@ Prerequisites: * **Optional** (to build the MSI): the [WiX Toolset v3.11](http://wixtoolset.org/releases/) and the [Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension). -If the path to your build directory contains a space or a non-ASCII character, the -build will likely fail. +If the path to your build directory contains a space or a non-ASCII character, +the build will likely fail. ```console > .\vcbuild diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f82ff8e86a064..87de8c4faa9b57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Node.js Changelog + + To make the changelog easier to both use and manage, it has been split into multiple files organized according to significant major and minor Node.js release lines. diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index f8daea5c643e52..941694ced34d1c 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -199,22 +199,23 @@ status indicator if possible. #### Useful CI Jobs * [`node-test-pull-request`](https://ci.nodejs.org/job/node-test-pull-request/) -is the standard CI run we do to check Pull Requests. It triggers `node-test-commit`, -which runs the `build-ci` and `test-ci` targets on all supported platforms. +is the standard CI run we do to check Pull Requests. It triggers +`node-test-commit`, which runs the `build-ci` and `test-ci` targets on all +supported platforms. * [`node-test-linter`](https://ci.nodejs.org/job/node-test-linter/) -only runs the linter targets, which is useful for changes that only affect comments -or documentation. +only runs the linter targets, which is useful for changes that only affect +comments or documentation. * [`node-test-pull-request-lite`](https://ci.nodejs.org/job/node-test-pull-request-lite/) -only runs the linter job, as well as the tests on LinuxONE. Should only be used for -trivial changes that do not require being tested on all platforms. +only runs the linter job, as well as the tests on LinuxONE. Should only be used +for trivial changes that do not require being tested on all platforms. * [`citgm-smoker`](https://ci.nodejs.org/job/citgm-smoker/) -uses [`CitGM`](https://github.com/nodejs/citgm) to allow you to run `npm install && npm test` -on a large selection of common modules. This is useful to check whether a -change will cause breakage in the ecosystem. To test Node.js ABI changes -you can run [`citgm-abi-smoker`](https://ci.nodejs.org/job/citgm-abi-smoker/). +uses [`CitGM`](https://github.com/nodejs/citgm) to allow you to run +`npm install && npm test` on a large selection of common modules. This is +useful to check whether a change will cause breakage in the ecosystem. To test +Node.js ABI changes you can run [`citgm-abi-smoker`](https://ci.nodejs.org/job/citgm-abi-smoker/). * [`node-stress-single-test`](https://ci.nodejs.org/job/node-stress-single-test/) is designed to allow one to run a group of tests over and over on a specific @@ -554,8 +555,8 @@ Apply external patches: $ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am --whitespace=fix ``` -If the merge fails even though recent CI runs were successful, then a 3-way merge may -be required. In this case try: +If the merge fails even though recent CI runs were successful, then a 3-way +merge may be required. In this case try: ```text $ git am --abort @@ -563,8 +564,9 @@ $ curl -L https://github.com/nodejs/node/pull/xxx.patch | git am -3 --whitespace ``` If the 3-way merge succeeds you can proceed, but make sure to check the changes against the original PR carefully and build/test on at least one platform -before landing. If the 3-way merge fails, then it is most likely that a conflicting -PR has landed since the CI run and you will have to ask the author to rebase. +before landing. If the 3-way merge fails, then it is most likely that a +conflicting PR has landed since the CI run and you will have to ask the author +to rebase. Check and re-review the changes: diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 23c1ac8bb5106e..83d4d9b50a7abe 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -159,9 +159,9 @@ repository, with a summary of the nominee's contributions, for example: * Participation in other projects, teams, and working groups of the Node.js organization * Can be shown using the links - `https://github.com/search?q=author%3A${GITHUB_ID}++org%3Anodejs&type=Issues` + `https://github.com/search?q=author%3A${GITHUB_ID}++org%3Anodejs&type=Issues` and - `https://github.com/search?q=commenter%3A${GITHUB_ID}++org%3Anodejs&type=Issues` +`https://github.com/search?q=commenter%3A${GITHUB_ID}++org%3Anodejs&type=Issues` * Other participation in the wider Node.js community Mention @nodejs/collaborators in the issue to notify other Collaborators about diff --git a/README.md b/README.md index 9ef437bac96d0c..5cc2bf699e3295 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@
diff --git a/doc/api/_toc.md b/doc/api/_toc.md index b8002fb78163ac..29b264e77b3c63 100644 --- a/doc/api/_toc.md +++ b/doc/api/_toc.md @@ -1,5 +1,4 @@ -@// NB(chrisdickinson): if you move this file, be sure to update tools/doc/html.js to -@// point at the new location. +@// NB(chrisdickinson): if you move this file, be sure to update @// tools/doc/html.js to point at the new location. diff --git a/doc/api/assert.md b/doc/api/assert.md index 2ecf628e4aa80a..dc877248dc5b3c 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -25,9 +25,9 @@ changes: description: Added strict mode to the assert module. --> -When using the `strict mode`, any `assert` function will use the equality used in -the strict function mode. So [`assert.deepEqual()`][] will, for example, work the -same as [`assert.deepStrictEqual()`][]. +When using the `strict mode`, any `assert` function will use the equality used +in the strict function mode. So [`assert.deepEqual()`][] will, for example, +work the same as [`assert.deepStrictEqual()`][]. On top of that, error messages which involve objects produce an error diff instead of displaying both objects. That is not the case for the legacy mode. @@ -209,8 +209,8 @@ changes: - version: v9.0.0 pr-url: https://github.com/nodejs/node/pull/15036 description: NaN is now compared using the - [SameValueZero](https://tc39.github.io/ecma262/#sec-samevaluezero) - comparison. + [SameValueZero](https://tc39.github.io/ecma262/#sec-samevaluezero) + comparison. - version: v8.5.0 pr-url: https://github.com/nodejs/node/pull/15001 description: Error names and messages are now properly compared @@ -595,8 +595,8 @@ changes: - version: v9.0.0 pr-url: https://github.com/nodejs/node/pull/15036 description: NaN is now compared using the - [SameValueZero](https://tc39.github.io/ecma262/#sec-samevaluezero) - comparison. + [SameValueZero](https://tc39.github.io/ecma262/#sec-samevaluezero) + comparison. - version: v9.0.0 pr-url: https://github.com/nodejs/node/pull/15001 description: Error names and messages are now properly compared diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 0daa4c8295e556..79276a6ef93ca9 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -206,8 +206,8 @@ instance is destroyed. * `type` {string} The type of the async resource. * `triggerAsyncId` {number} The unique ID of the async resource in whose execution context this async resource was created. -* `resource` {Object} Reference to the resource representing the async operation, - needs to be released during _destroy_. +* `resource` {Object} Reference to the resource representing the async + operation, needs to be released during _destroy_. Called when a class is constructed that has the _possibility_ to emit an asynchronous event. This _does not_ mean the instance must call @@ -283,11 +283,11 @@ The `TCPSERVERWRAP` is the server which receives the connections. The `TCPWRAP` is the new connection from the client. When a new connection is made the `TCPWrap` instance is immediately constructed. This -happens outside of any JavaScript stack (side note: a `executionAsyncId()` of `0` -means it's being executed from C++, with no JavaScript stack above it). +happens outside of any JavaScript stack (side note: a `executionAsyncId()` of +`0` means it's being executed from C++, with no JavaScript stack above it). With only that information, it would be impossible to link resources together in -terms of what caused them to be created, so `triggerAsyncId` is given the task of -propagating what resource is responsible for the new resource's existence. +terms of what caused them to be created, so `triggerAsyncId` is given the task +of propagating what resource is responsible for the new resource's existence. ###### `resource` @@ -582,8 +582,8 @@ the details of the V8 [PromiseHooks][] API. ## JavaScript Embedder API Library developers that handle their own asynchronous resources performing tasks -like I/O, connection pooling, or managing callback queues may use the `AsyncWrap` -JavaScript API so that all the appropriate callbacks are called. +like I/O, connection pooling, or managing callback queues may use the +`AsyncWrap` JavaScript API so that all the appropriate callbacks are called. ### `class AsyncResource()` @@ -728,8 +728,8 @@ never be called. #### `asyncResource.triggerAsyncId()` -* Returns: {number} The same `triggerAsyncId` that is passed to the `AsyncResource` -constructor. +* Returns: {number} The same `triggerAsyncId` that is passed to the +`AsyncResource` constructor. [`after` callback]: #async_hooks_after_asyncid [`asyncResource.runInAsyncScope()`]: #async_hooks_asyncresource_runinasyncscope_fn_thisarg_args diff --git a/doc/api/buffer.md b/doc/api/buffer.md index aa82ac66bd746d..df6912c9c6a6b8 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -1,6 +1,7 @@ # Buffer + > Stability: 2 - Stable diff --git a/doc/api/child_process.md b/doc/api/child_process.md index bc430897ba4ef2..be74f1fde76dc0 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1,6 +1,7 @@ # Child Process + > Stability: 2 - Stable diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 11be4d34d5bed8..08a669e4fa0f1f 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -269,8 +269,8 @@ changes: * Returns: {cluster.Worker} A reference to `worker`. -In a worker, this function will close all servers, wait for the `'close'` event on -those servers, and then disconnect the IPC channel. +In a worker, this function will close all servers, wait for the `'close'` event +on those servers, and then disconnect the IPC channel. In the master, an internal message is sent to the worker causing it to call `.disconnect()` on itself. @@ -280,8 +280,8 @@ Causes `.exitedAfterDisconnect` to be set. Note that after a server is closed, it will no longer accept new connections, but connections may be accepted by any other listening worker. Existing connections will be allowed to close as usual. When no more connections exist, -see [`server.close()`][], the IPC channel to the worker will close allowing it to -die gracefully. +see [`server.close()`][], the IPC channel to the worker will close allowing it +to die gracefully. The above applies *only* to server connections, client connections are not automatically closed by workers, and disconnect does not wait for them to close @@ -465,9 +465,9 @@ Emitted after the worker IPC channel has disconnected. This can occur when a worker exits gracefully, is killed, or is disconnected manually (such as with worker.disconnect()). -There may be a delay between the `'disconnect'` and `'exit'` events. These events -can be used to detect if the process is stuck in a cleanup or if there are -long-living connections. +There may be a delay between the `'disconnect'` and `'exit'` events. These +events can be used to detect if the process is stuck in a cleanup or if there +are long-living connections. ```js cluster.on('disconnect', (worker) => { @@ -639,7 +639,8 @@ Calls `.disconnect()` on each worker in `cluster.workers`. When they are disconnected all internal handles will be closed, allowing the master process to die gracefully if no other event is waiting. -The method takes an optional callback argument which will be called when finished. +The method takes an optional callback argument which will be called when +finished. This can only be called from the master process. diff --git a/doc/api/console.md b/doc/api/console.md index ea760e5e6ecab0..3665e9927187e0 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -449,7 +449,8 @@ added: v8.0.0 * `label` {string} Defaults to `'default'`. This method does not display anything unless used in the inspector. The -`console.markTimeline()` method is the deprecated form of [`console.timeStamp()`][]. +`console.markTimeline()` method is the deprecated form of +[`console.timeStamp()`][]. ### console.profile([label]) -Property for checking and controlling whether a FIPS compliant crypto provider is -currently in use. Setting to true requires a FIPS build of Node.js. +Property for checking and controlling whether a FIPS compliant crypto provider +is currently in use. Setting to true requires a FIPS build of Node.js. ### crypto.createCipher(algorithm, password[, options]) - `prime` {string | Buffer | TypedArray | DataView} - `primeEncoding` {string} -- `generator` {number | string | Buffer | TypedArray | DataView} Defaults to `2`. +- `generator` {number | string | Buffer | TypedArray | DataView} Defaults to + `2`. - `generatorEncoding` {string} Creates a `DiffieHellman` key exchange object using the supplied `prime` and an @@ -1404,7 +1406,8 @@ otherwise a number, [`Buffer`][], `TypedArray`, or `DataView` is expected. added: v0.5.0 --> - `primeLength` {number} -- `generator` {number | string | Buffer | TypedArray | DataView} Defaults to `2`. +- `generator` {number | string | Buffer | TypedArray | DataView} Defaults to + `2`. Creates a `DiffieHellman` key exchange object and generates a prime of `primeLength` bits using an optional specific numeric `generator`. diff --git a/doc/api/debugger.md b/doc/api/debugger.md index b0da263f5947b4..00dda306d09232 100644 --- a/doc/api/debugger.md +++ b/doc/api/debugger.md @@ -8,8 +8,8 @@ Node.js includes an out-of-process debugging utility accessible via a [V8 Inspector][] and built-in debugging client. To use it, start Node.js -with the `inspect` argument followed by the path to the script to debug; a prompt -will be displayed indicating successful launch of the debugger: +with the `inspect` argument followed by the path to the script to debug; a +prompt will be displayed indicating successful launch of the debugger: ```txt $ node inspect myscript.js @@ -173,7 +173,8 @@ breakpoint) ### V8 Inspector Integration for Node.js V8 Inspector integration allows attaching Chrome DevTools to Node.js -instances for debugging and profiling. It uses the [Chrome Debugging Protocol][]. +instances for debugging and profiling. It uses the +[Chrome Debugging Protocol][]. V8 Inspector can be enabled by passing the `--inspect` flag when starting a Node.js application. It is also possible to supply a custom port with that flag, diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index b5339e953ec97b..99925a375d6720 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -82,16 +82,16 @@ is strongly recommended: * [`Buffer.alloc(size[, fill[, encoding]])`][alloc] - Create a `Buffer` with *initialized* memory. -* [`Buffer.allocUnsafe(size)`][alloc_unsafe_size] - Create a `Buffer` with *uninitialized* - memory. +* [`Buffer.allocUnsafe(size)`][alloc_unsafe_size] - Create a `Buffer` with + *uninitialized* memory. * [`Buffer.allocUnsafeSlow(size)`][] - Create a `Buffer` with *uninitialized* memory. * [`Buffer.from(array)`][] - Create a `Buffer` with a copy of `array` -* [`Buffer.from(arrayBuffer[, byteOffset[, length]])`][from_arraybuffer] - Create a `Buffer` - that wraps the given `arrayBuffer`. +* [`Buffer.from(arrayBuffer[, byteOffset[, length]])`][from_arraybuffer] - + Create a `Buffer` that wraps the given `arrayBuffer`. * [`Buffer.from(buffer)`][] - Create a `Buffer` that copies `buffer`. -* [`Buffer.from(string[, encoding])`][from_string_encoding] - Create a `Buffer` that copies - `string`. +* [`Buffer.from(string[, encoding])`][from_string_encoding] - Create a `Buffer` + that copies `string`. ### DEP0006: child\_process options.customFds @@ -699,7 +699,8 @@ Type: Runtime `Module._debug()` has been deprecated. -The `Module._debug()` function was never documented as an officially supported API. +The `Module._debug()` function was never documented as an officially +supported API. ### DEP0078: REPLServer.turnOffEditorMode() diff --git a/doc/api/dgram.md b/doc/api/dgram.md index e44bf3eea5a166..9209b83a120247 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -394,8 +394,8 @@ added: v8.6.0 *Note: All references to scope in this section are referring to [IPv6 Zone Indices][], which are defined by [RFC 4007][]. In string form, an IP -with a scope index is written as `'IP%scope'` where scope is an interface name or -interface number.* +with a scope index is written as `'IP%scope'` where scope is an interface name +or interface number.* Sets the default outgoing multicast interface of the socket to a chosen interface or back to system interface selection. The `multicastInterface` must diff --git a/doc/api/dns.md b/doc/api/dns.md index cda4823e3ce0e7..fa7c34f654d011 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -143,8 +143,8 @@ changes: - `verbatim` {boolean} When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. - **Default:** currently `false` (addresses are reordered) but this is expected - to change in the not too distant future. + **Default:** currently `false` (addresses are reordered) but this is + expected to change in the not too distant future. New code should use `{ verbatim: true }`. - `callback` {Function} - `err` {Error} diff --git a/doc/api/documentation.md b/doc/api/documentation.md index c2413d33db8ae4..a864771f446dd9 100644 --- a/doc/api/documentation.md +++ b/doc/api/documentation.md @@ -85,8 +85,8 @@ like [`fs.open()`][], will document that. The docs link to the corresponding man pages (short for manual pages) which describe how the syscalls work. Some syscalls, like lchown(2), are BSD-specific. That means, for -example, that [`fs.lchown()`][] only works on macOS and other BSD-derived systems, -and is not available on Linux. +example, that [`fs.lchown()`][] only works on macOS and other BSD-derived +systems, and is not available on Linux. Most Unix syscalls have Windows equivalents, but behavior may differ on Windows relative to Linux and macOS. For an example of the subtle ways in which it's diff --git a/doc/api/domain.md b/doc/api/domain.md index b303b0fdeb1746..a9ca7f2d277be0 100644 --- a/doc/api/domain.md +++ b/doc/api/domain.md @@ -337,9 +337,9 @@ d.on('error', (er) => { The `enter` method is plumbing used by the `run`, `bind`, and `intercept` methods to set the active domain. It sets `domain.active` and `process.domain` to the domain, and implicitly pushes the domain onto the domain stack managed -by the domain module (see [`domain.exit()`][] for details on the domain stack). The -call to `enter` delimits the beginning of a chain of asynchronous calls and I/O -operations bound to a domain. +by the domain module (see [`domain.exit()`][] for details on the domain stack). +The call to `enter` delimits the beginning of a chain of asynchronous calls and +I/O operations bound to a domain. Calling `enter` changes only the active domain, and does not alter the domain itself. `enter` and `exit` can be called an arbitrary number of times on a diff --git a/doc/api/errors.md b/doc/api/errors.md index 82ebbcded0400c..d334bec7fe81c6 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -227,7 +227,8 @@ Error.captureStackTrace(myObject); myObject.stack; // similar to `new Error().stack` ``` -The first line of the trace will be prefixed with `${myObject.name}: ${myObject.message}`. +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. The optional `constructorOpt` argument accepts a function. If given, all frames above `constructorOpt`, including `constructorOpt`, will be omitted from the diff --git a/doc/api/esm.md b/doc/api/esm.md index 4f658bc6802ad9..9fcda68776a9bf 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -126,7 +126,8 @@ export async function resolve(specifier, } ``` -The parentURL is provided as `undefined` when performing main Node.js load itself. +The parentURL is provided as `undefined` when performing main Node.js load +itself. The default Node.js ES module resolution function is provided as a third argument to the resolver for easy compatibility workflows. diff --git a/doc/api/events.md b/doc/api/events.md index 7b510fac0505c0..afea4f443c9798 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -515,10 +515,10 @@ listener array for the specified `eventName`, then `removeListener` must be called multiple times to remove each instance. Note that once an event has been emitted, all listeners attached to it at the -time of emitting will be called in order. This implies that any `removeListener()` -or `removeAllListeners()` calls *after* emitting and *before* the last listener -finishes execution will not remove them from `emit()` in progress. Subsequent -events will behave as expected. +time of emitting will be called in order. This implies that any +`removeListener()` or `removeAllListeners()` calls *after* emitting and +*before* the last listener finishes execution will not remove them from +`emit()` in progress. Subsequent events will behave as expected. ```js const myEmitter = new MyEmitter(); diff --git a/doc/api/fs.md b/doc/api/fs.md index fc9bc7e9159f92..75b6fa987100e3 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2901,9 +2901,9 @@ directory. The returned object is a [`fs.FSWatcher`][]. The second argument is optional. If `options` is provided as a string, it specifies the `encoding`. Otherwise `options` should be passed as an object. -The listener callback gets two arguments `(eventType, filename)`. `eventType` is either -`'rename'` or `'change'`, and `filename` is the name of the file which triggered -the event. +The listener callback gets two arguments `(eventType, filename)`. `eventType` +is either `'rename'` or `'change'`, and `filename` is the name of the file +which triggered the event. Note that on most platforms, `'rename'` is emitted whenever a filename appears or disappears in the directory. diff --git a/doc/api/http.md b/doc/api/http.md index 076d0b6223f7b3..c0d3bacd9b70c9 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -225,7 +225,8 @@ added: v0.11.4 --> * `options` {Object} A set of options providing information for name generation - * `host` {string} A domain name or IP address of the server to issue the request to + * `host` {string} A domain name or IP address of the server to issue the + request to * `port` {number} Port of remote server * `localAddress` {string} Local interface to bind for network connections when issuing the request @@ -330,9 +331,9 @@ added: v0.7.0 * `socket` {net.Socket} * `head` {Buffer} -Emitted each time a server responds to a request with a `CONNECT` method. If this -event is not being listened for, clients receiving a `CONNECT` method will have -their connections closed. +Emitted each time a server responds to a request with a `CONNECT` method. If +this event is not being listened for, clients receiving a `CONNECT` method will +have their connections closed. A client and server pair demonstrating how to listen for the `'connect'` event: @@ -623,7 +624,8 @@ added: v0.5.9 --> * `timeout` {number} Milliseconds before a request times out. -* `callback` {Function} Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. +* `callback` {Function} Optional function to be called when a timeout occurs. + Same as binding to the `timeout` event. Once a socket is assigned to this request and is connected [`socket.setTimeout()`][] will be called. @@ -690,7 +692,8 @@ buffer. Returns `false` if all or part of the data was queued in user memory. added: v0.1.17 --> -This class inherits from [`net.Server`][] and has the following additional events: +This class inherits from [`net.Server`][] and has the following additional +events: ### Event: 'checkContinue' 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`. +the request body should be sent. See the [`'checkContinue'`][] event on +`Server`. ### response.writeHead(statusCode[, statusMessage][, headers]) -An [`Agent`][] object for HTTPS similar to [`http.Agent`][]. See [`https.request()`][] -for more information. +An [`Agent`][] object for HTTPS similar to [`http.Agent`][]. See +[`https.request()`][] for more information. ## Class: https.Server -- `options` {Object | string | URL} Accepts all `options` from [`http.request()`][], - with some differences in default values: +- `options` {Object | string | URL} Accepts all `options` from + [`http.request()`][], with some differences in default values: - `protocol` Defaults to `https:` - `port` Defaults to `443`. - `agent` Defaults to `https.globalAgent`. diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 454a14fe1ae12e..722504bc7b2f34 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -139,9 +139,9 @@ create a scope before invoking any functions that can result in the creation of JavaScript values. Handle scopes are created using [`napi_open_handle_scope`][] and are destroyed -using [`napi_close_handle_scope`][]. Closing the scope can indicate to the GC that -all `napi_value`s created during the lifetime of the handle scope are no longer -referenced from the current stack frame. +using [`napi_close_handle_scope`][]. Closing the scope can indicate to the GC +that all `napi_value`s created during the lifetime of the handle scope are no +longer referenced from the current stack frame. For more details, review the [Object Lifetime Management][]. @@ -667,7 +667,8 @@ current scope and the lifespan of the handle changes from the current scope to that of the outer scope. The methods available to open/close escapable scopes are -[`napi_open_escapable_handle_scope`][] and [`napi_close_escapable_handle_scope`][]. +[`napi_open_escapable_handle_scope`][] and +[`napi_close_escapable_handle_scope`][]. The request to promote a handle is made through [`napi_escape_handle`][] which can only be called once. @@ -1370,8 +1371,8 @@ TypedArray objects provide an array-like view over an underlying data buffer where each element has the same underlying binary scalar datatype. It's required that (length * size_of_element) + byte_offset should -be <= the size in bytes of the array passed in. If not, a RangeError exception is -raised. +be <= the size in bytes of the array passed in. If not, a RangeError exception +is raised. JavaScript TypedArray Objects are described in [Section 22.2][] of the ECMAScript Language Specification. @@ -1616,10 +1617,11 @@ its length. *WARNING*: Use caution while using this API. The lifetime of the underlying data buffer is managed by the ArrayBuffer even after it's returned. A -possible safe way to use this API is in conjunction with [`napi_create_reference`][], -which can be used to guarantee control over the lifetime of the -ArrayBuffer. It's also safe to use the returned data buffer within the same -callback as long as there are no calls to other APIs that might trigger a GC. +possible safe way to use this API is in conjunction with +[`napi_create_reference`][], which can be used to guarantee control over the +lifetime of the ArrayBuffer. It's also safe to use the returned data buffer +within the same callback as long as there are no calls to other APIs that might +trigger a GC. #### napi_get_buffer_info + > Stability: 2 - Stable diff --git a/doc/api/process.md b/doc/api/process.md index 6416376b550413..2bd7a119bf8d6c 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -193,9 +193,10 @@ of allocated resources (e.g. file descriptors, handles, etc) before shutting down the process. **It is not safe to resume normal operation after `'uncaughtException'`.** -To restart a crashed application in a more reliable way, whether `uncaughtException` -is emitted or not, an external monitor should be employed in a separate process -to detect application failures and recover or restart as needed. +To restart a crashed application in a more reliable way, whether +`uncaughtException` is emitted or not, an external monitor should be employed +in a separate process to detect application failures and recover or restart as +needed. ### Event: 'unhandledRejection' * `options` {Object} - * `input` {stream.Readable} The [Readable][] stream to listen to. This option is - *required*. - * `output` {stream.Writable} The [Writable][] stream to write readline data to. + * `input` {stream.Readable} The [Readable][] stream to listen to. This option + is *required*. + * `output` {stream.Writable} The [Writable][] stream to write readline data + to. * `completer` {Function} An optional function used for Tab autocompletion. * `terminal` {boolean} `true` if the `input` and `output` streams should be treated like a TTY, and have ANSI/VT100 escape codes written to it. Defaults to checking `isTTY` on the `output` stream upon instantiation. * `historySize` {number} Maximum number of history lines retained. To disable - the history set this value to `0`. This option makes sense only if `terminal` - is set to `true` by the user or by an internal `output` check, otherwise the - history caching mechanism is not initialized at all. **Default:** `30` + the history set this value to `0`. This option makes sense only if + `terminal` is set to `true` by the user or by an internal `output` check, + otherwise the history caching mechanism is not initialized at all. + **Default:** `30` * `prompt` {string} The prompt string to use. **Default:** `'> '` * `crlfDelay` {number} If the delay between `\r` and `\n` exceeds `crlfDelay` milliseconds, both `\r` and `\n` will be treated as separate - end-of-line input. `crlfDelay` will be coerced to a number no less than `100`. - It can be set to `Infinity`, in which case `\r` followed by `\n` will always be - considered a single newline (which may be reasonable for [reading files][] - with `\r\n` line delimiter). **Default:** `100` + end-of-line input. `crlfDelay` will be coerced to a number no less than + `100`. It can be set to `Infinity`, in which case `\r` followed by `\n` + will always be considered a single newline (which may be reasonable for + [reading files][] with `\r\n` line delimiter). **Default:** `100` * `removeHistoryDuplicates` {boolean} If `true`, when a new input line added to the history list duplicates an older one, this removes the older line from the list. **Default:** `false` diff --git a/doc/api/repl.md b/doc/api/repl.md index 581d51e99003b9..9717daaad192d5 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -429,8 +429,8 @@ changes: * `options` {Object|string} * `prompt` {string} The input prompt to display. Defaults to `> ` (with a trailing space). - * `input` {stream.Readable} The Readable stream from which REPL input will be read. - Defaults to `process.stdin`. + * `input` {stream.Readable} The Readable stream from which REPL input will be + read. Defaults to `process.stdin`. * `output` {stream.Writable} The Writable stream to which REPL output will be written. Defaults to `process.stdout`. * `terminal` {boolean} If `true`, specifies that the `output` should be diff --git a/doc/api/stream.md b/doc/api/stream.md index ce6b5fcf182736..ec4312a52e7ea5 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -423,8 +423,8 @@ stream.write('data '); process.nextTick(() => stream.uncork()); ``` -If the [`writable.cork()`][] method is called multiple times on a stream, the same -number of calls to `writable.uncork()` must be called to flush the buffered +If the [`writable.cork()`][] method is called multiple times on a stream, the +same number of calls to `writable.uncork()` must be called to flush the buffered data. ```js @@ -619,8 +619,8 @@ possible states: When `readable.readableFlowing` is `null`, no mechanism for consuming the streams data is provided so the stream will not generate its data. While in this -state, attaching a listener for the `'data'` event, calling the `readable.pipe()` -method, or calling the `readable.resume()` method will switch +state, attaching a listener for the `'data'` event, calling the +`readable.pipe()` method, or calling the `readable.resume()` method will switch `readable.readableFlowing` to `true`, causing the Readable to begin actively emitting events as data is generated. @@ -1267,8 +1267,11 @@ on the type of stream being created, as detailed in the chart below:[Writable](#stream_class_stream_writable)
[_write][stream-_write]
, [_writev][stream-_writev]
,
- [_final][stream-_final]
+ [_write][stream-_write]
,
+ [_writev][stream-_writev]
,
+ [_final][stream-_final]
+
[Duplex](#stream_class_stream_duplex)
[_read][stream-_read]
, [_write][stream-_write]
, [_writev][stream-_writev]
,
- [_final][stream-_final]
+ [_read][stream-_read]
,
+ [_write][stream-_write]
,
+ [_writev][stream-_writev]
,
+ [_final][stream-_final]
[Transform](#stream_class_stream_transform)
[_transform][stream-_transform]
, [_flush][stream-_flush]
,
- [_final][stream-_final]
+ [_transform][stream-_transform]
,
+ [_flush][stream-_flush]
,
+ [_final][stream-_final]
+