diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 0b4d4986e16e64..b65bf0c72ffe6a 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1005,6 +1005,15 @@ accepted by the legacy `url.parse()` API. The mentioned APIs now use the WHATWG URL parser that requires strictly valid URLs. Passing an invalid URL is deprecated and support will be removed in the future. + +### DEP0110: _getActiveHandles and _getActiveRequests + +Type: Runtime + +As `process.getActiveHandles()` and `process.getActiveRequests()` are +officially supported and documented, their previous names are now deprecated, +and will be removed in the future. + [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array diff --git a/doc/api/process.md b/doc/api/process.md index e6612278b6bc4a..d6b50ee5febeed 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1053,6 +1053,35 @@ a code. Specifying a code to [`process.exit(code)`][`process.exit()`] will override any previous setting of `process.exitCode`. +## process.getActiveHandles() + + +* Returns: {Array} + +Returns an array containing all handles that are preventing the Node.js process +from exiting. Be aware that the returned handles may not always correspond to +the user-created handles, but instead to an internal one. + +```js +console.log(`Active handles: ${util.inspect(process.getActiveHandles())}`); +``` + +## process.getActiveRequests() + + +* Returns: {Array} + +Returns an array containing all requests that are preventing the Node.js process +from exiting. + +```js +console.log(`Active requests: ${util.inspect(process.getActiveRequests())}`); +``` + ## process.getegid()