Skip to content

Commit e0dbc3c

Browse files
authored
🤖 Merge PR DefinitelyTyped#74661 node: do not emit module JSDoc headers by @Renegade334
1 parent f4c5d1d commit e0dbc3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1
-1563
lines changed

types/node/assert.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/**
2-
* The `node:assert` module provides a set of assertion functions for verifying
3-
* invariants.
4-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert.js)
5-
*/
61
declare module "node:assert" {
72
import strict = require("node:assert/strict");
83
/**

types/node/assert/strict.d.ts

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,3 @@
1-
/**
2-
* In strict assertion mode, non-strict methods behave like their corresponding
3-
* strict methods. For example, `assert.deepEqual()` will behave like
4-
* `assert.deepStrictEqual()`.
5-
*
6-
* In strict assertion mode, error messages for objects display a diff. In legacy
7-
* assertion mode, error messages for objects display the objects, often truncated.
8-
*
9-
* To use strict assertion mode:
10-
*
11-
* ```js
12-
* import { strict as assert } from 'node:assert';
13-
* ```
14-
*
15-
* ```js
16-
* import assert from 'node:assert/strict';
17-
* ```
18-
*
19-
* Example error diff:
20-
*
21-
* ```js
22-
* import { strict as assert } from 'node:assert';
23-
*
24-
* assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);
25-
* // AssertionError: Expected inputs to be strictly deep-equal:
26-
* // + actual - expected ... Lines skipped
27-
* //
28-
* // [
29-
* // [
30-
* // ...
31-
* // 2,
32-
* // + 3
33-
* // - '3'
34-
* // ],
35-
* // ...
36-
* // 5
37-
* // ]
38-
* ```
39-
*
40-
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS`
41-
* environment variables. This will also deactivate the colors in the REPL. For
42-
* more on color support in terminal environments, read the tty
43-
* [`getColorDepth()`](https://nodejs.org/docs/latest-v25.x/api/tty.html#writestreamgetcolordepthenv) documentation.
44-
* @since v15.0.0
45-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert/strict.js)
46-
*/
471
declare module "node:assert/strict" {
482
import {
493
Assert,

types/node/async_hooks.d.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* We strongly discourage the use of the `async_hooks` API.
3-
* Other APIs that can cover most of its use cases include:
4-
*
5-
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v25.x/api/async_context.html#class-asynclocalstorage) tracks async context
6-
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v25.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
7-
*
8-
* The `node:async_hooks` module provides an API to track asynchronous resources.
9-
* It can be accessed using:
10-
*
11-
* ```js
12-
* import async_hooks from 'node:async_hooks';
13-
* ```
14-
* @experimental
15-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/async_hooks.js)
16-
*/
171
declare module "node:async_hooks" {
182
/**
193
* ```js

types/node/buffer.d.ts

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,3 @@
1-
/**
2-
* `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
3-
* Node.js APIs support `Buffer`s.
4-
*
5-
* The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and
6-
* extends it with methods that cover additional use cases. Node.js APIs accept
7-
* plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well.
8-
*
9-
* While the `Buffer` class is available within the global scope, it is still
10-
* recommended to explicitly reference it via an import or require statement.
11-
*
12-
* ```js
13-
* import { Buffer } from 'node:buffer';
14-
*
15-
* // Creates a zero-filled Buffer of length 10.
16-
* const buf1 = Buffer.alloc(10);
17-
*
18-
* // Creates a Buffer of length 10,
19-
* // filled with bytes which all have the value `1`.
20-
* const buf2 = Buffer.alloc(10, 1);
21-
*
22-
* // Creates an uninitialized buffer of length 10.
23-
* // This is faster than calling Buffer.alloc() but the returned
24-
* // Buffer instance might contain old data that needs to be
25-
* // overwritten using fill(), write(), or other functions that fill the Buffer's
26-
* // contents.
27-
* const buf3 = Buffer.allocUnsafe(10);
28-
*
29-
* // Creates a Buffer containing the bytes [1, 2, 3].
30-
* const buf4 = Buffer.from([1, 2, 3]);
31-
*
32-
* // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries
33-
* // are all truncated using `(value & 255)` to fit into the range 0–255.
34-
* const buf5 = Buffer.from([257, 257.5, -255, '1']);
35-
*
36-
* // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':
37-
* // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)
38-
* // [116, 195, 169, 115, 116] (in decimal notation)
39-
* const buf6 = Buffer.from('tést');
40-
*
41-
* // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
42-
* const buf7 = Buffer.from('tést', 'latin1');
43-
* ```
44-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/buffer.js)
45-
*/
461
declare module "node:buffer" {
472
import { ReadableStream } from "node:stream/web";
483
/**

types/node/child_process.d.ts

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,3 @@
1-
/**
2-
* The `node:child_process` module provides the ability to spawn subprocesses in
3-
* a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability
4-
* is primarily provided by the {@link spawn} function:
5-
*
6-
* ```js
7-
* import { spawn } from 'node:child_process';
8-
* import { once } from 'node:events';
9-
* const ls = spawn('ls', ['-lh', '/usr']);
10-
*
11-
* ls.stdout.on('data', (data) => {
12-
* console.log(`stdout: ${data}`);
13-
* });
14-
*
15-
* ls.stderr.on('data', (data) => {
16-
* console.error(`stderr: ${data}`);
17-
* });
18-
*
19-
* const [code] = await once(ls, 'close');
20-
* console.log(`child process exited with code ${code}`);
21-
* ```
22-
*
23-
* By default, pipes for `stdin`, `stdout`, and `stderr` are established between
24-
* the parent Node.js process and the spawned subprocess. These pipes have
25-
* limited (and platform-specific) capacity. If the subprocess writes to
26-
* stdout in excess of that limit without the output being captured, the
27-
* subprocess blocks, waiting for the pipe buffer to accept more data. This is
28-
* identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed.
29-
*
30-
* The command lookup is performed using the `options.env.PATH` environment
31-
* variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is
32-
* used. If `options.env` is set without `PATH`, lookup on Unix is performed
33-
* on a default search path search of `/usr/bin:/bin` (see your operating system's
34-
* manual for execvpe/execvp), on Windows the current processes environment
35-
* variable `PATH` is used.
36-
*
37-
* On Windows, environment variables are case-insensitive. Node.js
38-
* lexicographically sorts the `env` keys and uses the first one that
39-
* case-insensitively matches. Only first (in lexicographic order) entry will be
40-
* passed to the subprocess. This might lead to issues on Windows when passing
41-
* objects to the `env` option that have multiple variants of the same key, such as `PATH` and `Path`.
42-
*
43-
* The {@link spawn} method spawns the child process asynchronously,
44-
* without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks
45-
* the event loop until the spawned process either exits or is terminated.
46-
*
47-
* For convenience, the `node:child_process` module provides a handful of
48-
* synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on
49-
* top of {@link spawn} or {@link spawnSync}.
50-
*
51-
* * {@link exec}: spawns a shell and runs a command within that
52-
* shell, passing the `stdout` and `stderr` to a callback function when
53-
* complete.
54-
* * {@link execFile}: similar to {@link exec} except
55-
* that it spawns the command directly without first spawning a shell by
56-
* default.
57-
* * {@link fork}: spawns a new Node.js process and invokes a
58-
* specified module with an IPC communication channel established that allows
59-
* sending messages between parent and child.
60-
* * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop.
61-
* * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop.
62-
*
63-
* For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
64-
* the synchronous methods can have significant impact on performance due to
65-
* stalling the event loop while spawned processes complete.
66-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/child_process.js)
67-
*/
681
declare module "node:child_process" {
692
import { NonSharedBuffer } from "node:buffer";
703
import * as dgram from "node:dgram";

types/node/cluster.d.ts

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,3 @@
1-
/**
2-
* Clusters of Node.js processes can be used to run multiple instances of Node.js
3-
* that can distribute workloads among their application threads. When process isolation
4-
* is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html)
5-
* module instead, which allows running multiple application threads within a single Node.js instance.
6-
*
7-
* The cluster module allows easy creation of child processes that all share
8-
* server ports.
9-
*
10-
* ```js
11-
* import cluster from 'node:cluster';
12-
* import http from 'node:http';
13-
* import { availableParallelism } from 'node:os';
14-
* import process from 'node:process';
15-
*
16-
* const numCPUs = availableParallelism();
17-
*
18-
* if (cluster.isPrimary) {
19-
* console.log(`Primary ${process.pid} is running`);
20-
*
21-
* // Fork workers.
22-
* for (let i = 0; i < numCPUs; i++) {
23-
* cluster.fork();
24-
* }
25-
*
26-
* cluster.on('exit', (worker, code, signal) => {
27-
* console.log(`worker ${worker.process.pid} died`);
28-
* });
29-
* } else {
30-
* // Workers can share any TCP connection
31-
* // In this case it is an HTTP server
32-
* http.createServer((req, res) => {
33-
* res.writeHead(200);
34-
* res.end('hello world\n');
35-
* }).listen(8000);
36-
*
37-
* console.log(`Worker ${process.pid} started`);
38-
* }
39-
* ```
40-
*
41-
* Running Node.js will now share port 8000 between the workers:
42-
*
43-
* ```console
44-
* $ node server.js
45-
* Primary 3596 is running
46-
* Worker 4324 started
47-
* Worker 4520 started
48-
* Worker 6056 started
49-
* Worker 5644 started
50-
* ```
51-
*
52-
* On Windows, it is not yet possible to set up a named pipe server in a worker.
53-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/cluster.js)
54-
*/
551
declare module "node:cluster" {
562
import * as child_process from "node:child_process";
573
import { EventEmitter, InternalEventEmitter } from "node:events";

types/node/console.d.ts

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,3 @@
1-
/**
2-
* The `node:console` module provides a simple debugging console that is similar to
3-
* the JavaScript console mechanism provided by web browsers.
4-
*
5-
* The module exports two specific components:
6-
*
7-
* * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream.
8-
* * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdout) and
9-
* [`process.stderr`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
10-
*
11-
* _**Warning**_: The global console object's methods are neither consistently
12-
* synchronous like the browser APIs they resemble, nor are they consistently
13-
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v25.x/api/process.html#a-note-on-process-io) for
14-
* more information.
15-
*
16-
* Example using the global `console`:
17-
*
18-
* ```js
19-
* console.log('hello world');
20-
* // Prints: hello world, to stdout
21-
* console.log('hello %s', 'world');
22-
* // Prints: hello world, to stdout
23-
* console.error(new Error('Whoops, something bad happened'));
24-
* // Prints error message and stack trace to stderr:
25-
* // Error: Whoops, something bad happened
26-
* // at [eval]:5:15
27-
* // at Script.runInThisContext (node:vm:132:18)
28-
* // at Object.runInThisContext (node:vm:309:38)
29-
* // at node:internal/process/execution:77:19
30-
* // at [eval]-wrapper:6:22
31-
* // at evalScript (node:internal/process/execution:76:60)
32-
* // at node:internal/main/eval_string:23:3
33-
*
34-
* const name = 'Will Robinson';
35-
* console.warn(`Danger ${name}! Danger!`);
36-
* // Prints: Danger Will Robinson! Danger!, to stderr
37-
* ```
38-
*
39-
* Example using the `Console` class:
40-
*
41-
* ```js
42-
* const out = getStreamSomehow();
43-
* const err = getStreamSomehow();
44-
* const myConsole = new console.Console(out, err);
45-
*
46-
* myConsole.log('hello world');
47-
* // Prints: hello world, to out
48-
* myConsole.log('hello %s', 'world');
49-
* // Prints: hello world, to out
50-
* myConsole.error(new Error('Whoops, something bad happened'));
51-
* // Prints: [Error: Whoops, something bad happened], to err
52-
*
53-
* const name = 'Will Robinson';
54-
* myConsole.warn(`Danger ${name}! Danger!`);
55-
* // Prints: Danger Will Robinson! Danger!, to err
56-
* ```
57-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/console.js)
58-
*/
591
declare module "node:console" {
602
import { InspectOptions } from "node:util";
613
namespace console {

types/node/constants.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/**
2-
* @deprecated The `node:constants` module is deprecated. When requiring access to constants
3-
* relevant to specific Node.js builtin modules, developers should instead refer
4-
* to the `constants` property exposed by the relevant module. For instance,
5-
* `require('node:fs').constants` and `require('node:os').constants`.
6-
*/
71
declare module "node:constants" {
82
const constants:
93
& typeof import("node:os").constants.dlopen

types/node/crypto.d.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
/**
2-
* The `node:crypto` module provides cryptographic functionality that includes a
3-
* set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify
4-
* functions.
5-
*
6-
* ```js
7-
* const { createHmac } = await import('node:crypto');
8-
*
9-
* const secret = 'abcdefg';
10-
* const hash = createHmac('sha256', secret)
11-
* .update('I love cupcakes')
12-
* .digest('hex');
13-
* console.log(hash);
14-
* // Prints:
15-
* // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
16-
* ```
17-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/crypto.js)
18-
*/
191
declare module "node:crypto" {
202
import { NonSharedBuffer } from "node:buffer";
213
import * as stream from "node:stream";

types/node/dgram.d.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
1-
/**
2-
* The `node:dgram` module provides an implementation of UDP datagram sockets.
3-
*
4-
* ```js
5-
* import dgram from 'node:dgram';
6-
*
7-
* const server = dgram.createSocket('udp4');
8-
*
9-
* server.on('error', (err) => {
10-
* console.error(`server error:\n${err.stack}`);
11-
* server.close();
12-
* });
13-
*
14-
* server.on('message', (msg, rinfo) => {
15-
* console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
16-
* });
17-
*
18-
* server.on('listening', () => {
19-
* const address = server.address();
20-
* console.log(`server listening ${address.address}:${address.port}`);
21-
* });
22-
*
23-
* server.bind(41234);
24-
* // Prints: server listening 0.0.0.0:41234
25-
* ```
26-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/dgram.js)
27-
*/
281
declare module "node:dgram" {
292
import { NonSharedBuffer } from "node:buffer";
303
import * as dns from "node:dns";

0 commit comments

Comments
 (0)