@types/node
Advanced tools
+4
-4
@@ -231,9 +231,9 @@ /** | ||
| /** | ||
| * @since v18.8.0,v16.19.0 | ||
| * @return the number of bytes queued for sending. | ||
| * @since v18.8.0, v16.19.0 | ||
| * @return Number of bytes queued for sending. | ||
| */ | ||
| getSendQueueSize(): number; | ||
| /** | ||
| * @since v18.8.0,v16.19.0 | ||
| * @return the number of send requests currently in the queue awaiting to be processed. | ||
| * @since v18.8.0, v16.19.0 | ||
| * @return Number of send requests currently in the queue awaiting to be processed. | ||
| */ | ||
@@ -240,0 +240,0 @@ getSendQueueCount(): number; |
+14
-0
@@ -279,2 +279,16 @@ /** | ||
| interface ImportMeta { | ||
| /** | ||
| * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. | ||
| * **Caveat:** only present on `file:` modules. | ||
| */ | ||
| dirname?: string; | ||
| /** | ||
| * The full absolute path and filename of the current module, with symlinks resolved. | ||
| * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. | ||
| * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it. | ||
| */ | ||
| filename?: string; | ||
| /** | ||
| * The absolute `file:` URL of the module. | ||
| */ | ||
| url: string; | ||
@@ -281,0 +295,0 @@ /** |
| { | ||
| "name": "@types/node", | ||
| "version": "20.10.8", | ||
| "version": "20.11.1", | ||
| "description": "TypeScript definitions for node", | ||
@@ -227,5 +227,5 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", | ||
| }, | ||
| "typesPublisherContentHash": "81a6ffec7851a9499bdc79517eb318d5db43383eae84c65f2509a4319d302d31", | ||
| "typesPublisherContentHash": "72bb627c28cb083a2dfb425e00616f0537b9722bf7784a8bebbe37aad9154842", | ||
| "typeScriptVersion": "4.6", | ||
| "nonNpm": true | ||
| } |
+12
-6
@@ -317,3 +317,4 @@ /** | ||
| * * startTime: 81.465639, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * }, | ||
@@ -324,3 +325,4 @@ * * PerformanceEntry { | ||
| * * startTime: 81.860064, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * } | ||
@@ -360,3 +362,4 @@ * * ] | ||
| * * startTime: 98.545991, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * } | ||
@@ -374,3 +377,4 @@ * * ] | ||
| * * startTime: 63.518931, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * } | ||
@@ -411,3 +415,4 @@ * * ] | ||
| * * startTime: 55.897834, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * }, | ||
@@ -418,3 +423,4 @@ * * PerformanceEntry { | ||
| * * startTime: 56.350146, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * } | ||
@@ -421,0 +427,0 @@ * * ] |
@@ -77,6 +77,6 @@ /** | ||
| * | ||
| * ```js | ||
| * ```json | ||
| * { | ||
| * foo: 'bar', | ||
| * abc: ['xyz', '123'] | ||
| * "foo": "bar", | ||
| * "abc": ["xyz", "123"] | ||
| * } | ||
@@ -83,0 +83,0 @@ * ``` |
+1
-1
@@ -11,3 +11,3 @@ # Installation | ||
| ### Additional Details | ||
| * Last updated: Tue, 09 Jan 2024 15:35:40 GMT | ||
| * Last updated: Mon, 15 Jan 2024 04:07:53 GMT | ||
| * Dependencies: [undici-types](https://npmjs.com/package/undici-types) | ||
@@ -14,0 +14,0 @@ |
+62
-10
@@ -85,2 +85,7 @@ /** | ||
| /** | ||
| * **Note:**`shard` is used to horizontally parallelize test running across | ||
| * machines or processes, ideal for large-scale executions across varied | ||
| * environments. It's incompatible with `watch` mode, tailored for rapid | ||
| * code iteration by automatically rerunning tests on file changes. | ||
| * | ||
| * ```js | ||
@@ -1017,2 +1022,4 @@ * import { tap } from 'node:test/reporters'; | ||
| * | ||
| * MockTimers is also able to mock the `Date` object. | ||
| * | ||
| * The `MockTracker` provides a top-level `timers` export | ||
@@ -1030,7 +1037,10 @@ * which is a `MockTimers` instance. | ||
| * | ||
| * Example usage: | ||
| * **Note:** Mocking `Date` will affect the behavior of the mocked timers | ||
| * as they use the same internal clock. | ||
| * | ||
| * Example usage without setting initial time: | ||
| * | ||
| * ```js | ||
| * import { mock } from 'node:test'; | ||
| * mock.timers.enable(['setInterval']); | ||
| * mock.timers.enable({ apis: ['setInterval'] }); | ||
| * ``` | ||
@@ -1041,2 +1051,16 @@ * | ||
| * | ||
| * Example usage with initial time set | ||
| * | ||
| * ```js | ||
| * import { mock } from 'node:test'; | ||
| * mock.timers.enable({ apis: ['Date'], now: 1000 }); | ||
| * ``` | ||
| * | ||
| * Example usage with initial Date object as time set | ||
| * | ||
| * ```js | ||
| * import { mock } from 'node:test'; | ||
| * mock.timers.enable({ apis: ['Date'], now: new Date() }); | ||
| * ``` | ||
| * | ||
| * Alternatively, if you call `mock.timers.enable()` without any parameters: | ||
@@ -1046,3 +1070,3 @@ * | ||
| * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`, | ||
| * and `globalThis` will be mocked. | ||
| * and `globalThis` will be mocked. As well as the global `Date` object. | ||
| * @since v20.4.0 | ||
@@ -1084,3 +1108,3 @@ */ | ||
| * | ||
| * context.mock.timers.enable(['setTimeout']); | ||
| * context.mock.timers.enable({ apis: ['setTimeout'] }); | ||
| * | ||
@@ -1106,3 +1130,3 @@ * setTimeout(fn, 9999); | ||
| * const fn = context.mock.fn(); | ||
| * context.mock.timers.enable(['setTimeout']); | ||
| * context.mock.timers.enable({ apis: ['setTimeout'] }); | ||
| * const nineSecs = 9000; | ||
@@ -1119,2 +1143,25 @@ * setTimeout(fn, nineSecs); | ||
| * ``` | ||
| * | ||
| * Advancing time using `.tick` will also advance the time for any `Date` object | ||
| * created after the mock was enabled (if `Date` was also set to be mocked). | ||
| * | ||
| * ```js | ||
| * import assert from 'node:assert'; | ||
| * import { test } from 'node:test'; | ||
| * | ||
| * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { | ||
| * const fn = context.mock.fn(); | ||
| * | ||
| * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); | ||
| * setTimeout(fn, 9999); | ||
| * | ||
| * assert.strictEqual(fn.mock.callCount(), 0); | ||
| * assert.strictEqual(Date.now(), 0); | ||
| * | ||
| * // Advance in time | ||
| * context.mock.timers.tick(9999); | ||
| * assert.strictEqual(fn.mock.callCount(), 1); | ||
| * assert.strictEqual(Date.now(), 9999); | ||
| * }); | ||
| * ``` | ||
| * @since v20.4.0 | ||
@@ -1124,3 +1171,4 @@ */ | ||
| /** | ||
| * Triggers all pending mocked timers immediately. | ||
| * Triggers all pending mocked timers immediately. If the `Date` object is also | ||
| * mocked, it will also advance the `Date` object to the furthest timer's time. | ||
| * | ||
@@ -1135,3 +1183,3 @@ * The example below triggers all pending timers immediately, | ||
| * test('runAll functions following the given order', (context) => { | ||
| * context.mock.timers.enable(['setTimeout']); | ||
| * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); | ||
| * const results = []; | ||
@@ -1148,4 +1196,5 @@ * setTimeout(() => results.push(1), 9999); | ||
| * context.mock.timers.runAll(); | ||
| * | ||
| * assert.deepStrictEqual(results, [3, 2, 1]); | ||
| * // The Date object is also advanced to the furthest timer's time | ||
| * assert.strictEqual(Date.now(), 9999); | ||
| * }); | ||
@@ -1357,3 +1406,3 @@ * ``` | ||
| declare module "node:test/reporters" { | ||
| import { Transform } from "node:stream"; | ||
| import { Transform, TransformOptions } from "node:stream"; | ||
@@ -1393,3 +1442,6 @@ type TestEvent = | ||
| function junit(source: TestEventGenerator): AsyncGenerator<string, void>; | ||
| export { dot, junit, Spec as spec, tap, TestEvent }; | ||
| class Lcov extends Transform { | ||
| constructor(opts?: TransformOptions); | ||
| } | ||
| export { dot, junit, Lcov as lcov, Spec as spec, tap, TestEvent }; | ||
| } |
@@ -231,9 +231,9 @@ /** | ||
| /** | ||
| * @since v18.8.0,v16.19.0 | ||
| * @return the number of bytes queued for sending. | ||
| * @since v18.8.0, v16.19.0 | ||
| * @return Number of bytes queued for sending. | ||
| */ | ||
| getSendQueueSize(): number; | ||
| /** | ||
| * @since v18.8.0,v16.19.0 | ||
| * @return the number of send requests currently in the queue awaiting to be processed. | ||
| * @since v18.8.0, v16.19.0 | ||
| * @return Number of send requests currently in the queue awaiting to be processed. | ||
| */ | ||
@@ -240,0 +240,0 @@ getSendQueueCount(): number; |
@@ -279,2 +279,16 @@ /** | ||
| interface ImportMeta { | ||
| /** | ||
| * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. | ||
| * **Caveat:** only present on `file:` modules. | ||
| */ | ||
| dirname?: string; | ||
| /** | ||
| * The full absolute path and filename of the current module, with symlinks resolved. | ||
| * This is the same as the `url.fileURLToPath()` of the `import.meta.url`. | ||
| * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it. | ||
| */ | ||
| filename?: string; | ||
| /** | ||
| * The absolute `file:` URL of the module. | ||
| */ | ||
| url: string; | ||
@@ -281,0 +295,0 @@ /** |
@@ -34,3 +34,3 @@ /** | ||
| import { AsyncResource } from "node:async_hooks"; | ||
| type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http"; | ||
| type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns" | "net"; | ||
| interface NodeGCPerformanceDetail { | ||
@@ -318,3 +318,4 @@ /** | ||
| * * startTime: 81.465639, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * }, | ||
@@ -325,3 +326,4 @@ * * PerformanceEntry { | ||
| * * startTime: 81.860064, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * } | ||
@@ -361,3 +363,4 @@ * * ] | ||
| * * startTime: 98.545991, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * } | ||
@@ -375,3 +378,4 @@ * * ] | ||
| * * startTime: 63.518931, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * } | ||
@@ -412,3 +416,4 @@ * * ] | ||
| * * startTime: 55.897834, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * }, | ||
@@ -419,3 +424,4 @@ * * PerformanceEntry { | ||
| * * startTime: 56.350146, | ||
| * * duration: 0 | ||
| * * duration: 0, | ||
| * * detail: null | ||
| * * } | ||
@@ -422,0 +428,0 @@ * * ] |
@@ -77,6 +77,6 @@ /** | ||
| * | ||
| * ```js | ||
| * ```json | ||
| * { | ||
| * foo: 'bar', | ||
| * abc: ['xyz', '123'] | ||
| * "foo": "bar", | ||
| * "abc": ["xyz", "123"] | ||
| * } | ||
@@ -83,0 +83,0 @@ * ``` |
+62
-10
@@ -85,2 +85,7 @@ /** | ||
| /** | ||
| * **Note:**`shard` is used to horizontally parallelize test running across | ||
| * machines or processes, ideal for large-scale executions across varied | ||
| * environments. It's incompatible with `watch` mode, tailored for rapid | ||
| * code iteration by automatically rerunning tests on file changes. | ||
| * | ||
| * ```js | ||
@@ -1017,2 +1022,4 @@ * import { tap } from 'node:test/reporters'; | ||
| * | ||
| * MockTimers is also able to mock the `Date` object. | ||
| * | ||
| * The `MockTracker` provides a top-level `timers` export | ||
@@ -1030,7 +1037,10 @@ * which is a `MockTimers` instance. | ||
| * | ||
| * Example usage: | ||
| * **Note:** Mocking `Date` will affect the behavior of the mocked timers | ||
| * as they use the same internal clock. | ||
| * | ||
| * Example usage without setting initial time: | ||
| * | ||
| * ```js | ||
| * import { mock } from 'node:test'; | ||
| * mock.timers.enable(['setInterval']); | ||
| * mock.timers.enable({ apis: ['setInterval'] }); | ||
| * ``` | ||
@@ -1041,2 +1051,16 @@ * | ||
| * | ||
| * Example usage with initial time set | ||
| * | ||
| * ```js | ||
| * import { mock } from 'node:test'; | ||
| * mock.timers.enable({ apis: ['Date'], now: 1000 }); | ||
| * ``` | ||
| * | ||
| * Example usage with initial Date object as time set | ||
| * | ||
| * ```js | ||
| * import { mock } from 'node:test'; | ||
| * mock.timers.enable({ apis: ['Date'], now: new Date() }); | ||
| * ``` | ||
| * | ||
| * Alternatively, if you call `mock.timers.enable()` without any parameters: | ||
@@ -1046,3 +1070,3 @@ * | ||
| * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`, | ||
| * and `globalThis` will be mocked. | ||
| * and `globalThis` will be mocked. As well as the global `Date` object. | ||
| * @since v20.4.0 | ||
@@ -1084,3 +1108,3 @@ */ | ||
| * | ||
| * context.mock.timers.enable(['setTimeout']); | ||
| * context.mock.timers.enable({ apis: ['setTimeout'] }); | ||
| * | ||
@@ -1106,3 +1130,3 @@ * setTimeout(fn, 9999); | ||
| * const fn = context.mock.fn(); | ||
| * context.mock.timers.enable(['setTimeout']); | ||
| * context.mock.timers.enable({ apis: ['setTimeout'] }); | ||
| * const nineSecs = 9000; | ||
@@ -1119,2 +1143,25 @@ * setTimeout(fn, nineSecs); | ||
| * ``` | ||
| * | ||
| * Advancing time using `.tick` will also advance the time for any `Date` object | ||
| * created after the mock was enabled (if `Date` was also set to be mocked). | ||
| * | ||
| * ```js | ||
| * import assert from 'node:assert'; | ||
| * import { test } from 'node:test'; | ||
| * | ||
| * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { | ||
| * const fn = context.mock.fn(); | ||
| * | ||
| * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); | ||
| * setTimeout(fn, 9999); | ||
| * | ||
| * assert.strictEqual(fn.mock.callCount(), 0); | ||
| * assert.strictEqual(Date.now(), 0); | ||
| * | ||
| * // Advance in time | ||
| * context.mock.timers.tick(9999); | ||
| * assert.strictEqual(fn.mock.callCount(), 1); | ||
| * assert.strictEqual(Date.now(), 9999); | ||
| * }); | ||
| * ``` | ||
| * @since v20.4.0 | ||
@@ -1124,3 +1171,4 @@ */ | ||
| /** | ||
| * Triggers all pending mocked timers immediately. | ||
| * Triggers all pending mocked timers immediately. If the `Date` object is also | ||
| * mocked, it will also advance the `Date` object to the furthest timer's time. | ||
| * | ||
@@ -1135,3 +1183,3 @@ * The example below triggers all pending timers immediately, | ||
| * test('runAll functions following the given order', (context) => { | ||
| * context.mock.timers.enable(['setTimeout']); | ||
| * context.mock.timers.enable({ apis: ['setTimeout', 'Date'] }); | ||
| * const results = []; | ||
@@ -1148,4 +1196,5 @@ * setTimeout(() => results.push(1), 9999); | ||
| * context.mock.timers.runAll(); | ||
| * | ||
| * assert.deepStrictEqual(results, [3, 2, 1]); | ||
| * // The Date object is also advanced to the furthest timer's time | ||
| * assert.strictEqual(Date.now(), 9999); | ||
| * }); | ||
@@ -1357,3 +1406,3 @@ * ``` | ||
| declare module "node:test/reporters" { | ||
| import { Transform } from "node:stream"; | ||
| import { Transform, TransformOptions } from "node:stream"; | ||
@@ -1393,3 +1442,6 @@ type TestEvent = | ||
| function junit(source: TestEventGenerator): AsyncGenerator<string, void>; | ||
| export { dot, junit, Spec as spec, tap, TestEvent }; | ||
| class Lcov extends Transform { | ||
| constructor(opts?: TransformOptions); | ||
| } | ||
| export { dot, junit, Lcov as lcov, Spec as spec, tap, TestEvent }; | ||
| } |
| /** | ||
| * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives sandboxed WebAssembly applications access to the | ||
| * underlying operating system via a collection of POSIX-like functions. | ||
| * **The `node:wasi` module does not currently provide the** | ||
| * **comprehensive file system security properties provided by some WASI runtimes.** | ||
| * **Full support for secure file system sandboxing may or may not be implemented in** | ||
| * **future. In the mean time, do not rely on it to run untrusted code.** | ||
| * | ||
| * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives WebAssembly applications access to the underlying | ||
| * operating system via a collection of POSIX-like functions. | ||
| * | ||
| * ```js | ||
@@ -15,3 +20,3 @@ * import { readFile } from 'node:fs/promises'; | ||
| * preopens: { | ||
| * '/sandbox': '/some/real/path/that/wasm/can/access', | ||
| * '/local': '/some/real/path/that/wasm/can/access', | ||
| * }, | ||
@@ -121,4 +126,3 @@ * }); | ||
| * methods for working with WASI-based applications. Each `WASI` instance | ||
| * represents a distinct sandbox environment. For security purposes, each `WASI`instance must have its command-line arguments, environment variables, and | ||
| * sandbox directory structure configured explicitly. | ||
| * represents a distinct environment. | ||
| * @since v13.3.0, v12.16.0 | ||
@@ -125,0 +129,0 @@ */ |
+9
-5
| /** | ||
| * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives sandboxed WebAssembly applications access to the | ||
| * underlying operating system via a collection of POSIX-like functions. | ||
| * **The `node:wasi` module does not currently provide the** | ||
| * **comprehensive file system security properties provided by some WASI runtimes.** | ||
| * **Full support for secure file system sandboxing may or may not be implemented in** | ||
| * **future. In the mean time, do not rely on it to run untrusted code.** | ||
| * | ||
| * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives WebAssembly applications access to the underlying | ||
| * operating system via a collection of POSIX-like functions. | ||
| * | ||
| * ```js | ||
@@ -15,3 +20,3 @@ * import { readFile } from 'node:fs/promises'; | ||
| * preopens: { | ||
| * '/sandbox': '/some/real/path/that/wasm/can/access', | ||
| * '/local': '/some/real/path/that/wasm/can/access', | ||
| * }, | ||
@@ -121,4 +126,3 @@ * }); | ||
| * methods for working with WASI-based applications. Each `WASI` instance | ||
| * represents a distinct sandbox environment. For security purposes, each `WASI`instance must have its command-line arguments, environment variables, and | ||
| * sandbox directory structure configured explicitly. | ||
| * represents a distinct environment. | ||
| * @since v13.3.0, v12.16.0 | ||
@@ -125,0 +129,0 @@ */ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 9 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 10 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 9 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 10 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
3975211
0.23%89841
0.22%535
1.13%