@contrast/agent-bundle 5.46.0 → 5.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/node_modules/@contrast/agent/README.md +1 -1
- package/node_modules/@contrast/agent/package.json +12 -12
- package/node_modules/@contrast/agentify/package.json +15 -15
- package/node_modules/@contrast/architecture-components/package.json +5 -5
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/common.js +1 -1
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/handlers.js +23 -10
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/index.js +6 -4
- package/node_modules/@contrast/assess/lib/configuration-analysis/install/apollo-server.js +92 -0
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/express-session.js +2 -2
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/fastify-cookie.js +2 -2
- package/node_modules/@contrast/assess/lib/configuration-analysis/install/graphql-yoga.js +90 -0
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/hapi.js +2 -2
- package/node_modules/@contrast/assess/lib/{session-configuration → configuration-analysis}/install/koa.js +3 -3
- package/node_modules/@contrast/assess/lib/dataflow/propagation/install/string/substring.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/handler.js +9 -2
- package/node_modules/@contrast/assess/lib/dataflow/sources/index.js +2 -0
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/fastify-websocket.js +63 -0
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/http.js +42 -38
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/index.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-bodyparsers.js +76 -48
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-multer.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-routers.js +2 -2
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/{koa2.js → koa.js} +3 -3
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/socket.io.js +80 -0
- package/node_modules/@contrast/assess/lib/index.d.ts +4 -3
- package/node_modules/@contrast/assess/lib/index.js +1 -1
- package/node_modules/@contrast/assess/lib/policy.js +2 -2
- package/node_modules/@contrast/assess/package.json +12 -12
- package/node_modules/@contrast/common/lib/constants.d.ts +12 -4
- package/node_modules/@contrast/common/lib/constants.js +16 -7
- package/node_modules/@contrast/common/lib/types.d.ts +5 -1
- package/node_modules/@contrast/common/package.json +1 -1
- package/node_modules/@contrast/config/lib/common.js +1 -0
- package/node_modules/@contrast/config/lib/options.js +7 -1
- package/node_modules/@contrast/config/package.json +3 -3
- package/node_modules/@contrast/core/package.json +5 -5
- package/node_modules/@contrast/deadzones/package.json +5 -5
- package/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +2 -2
- package/node_modules/@contrast/dep-hooks/lib/package-finder.js +3 -2
- package/node_modules/@contrast/dep-hooks/package.json +4 -4
- package/node_modules/@contrast/esm-hooks/README.md +2 -2
- package/node_modules/@contrast/esm-hooks/package.json +6 -6
- package/node_modules/@contrast/instrumentation/package.json +5 -5
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +149 -149
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/index.js +2 -11
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/utils.js +2 -0
- package/node_modules/@contrast/library-analysis/lib/install/library-usage/index.js +3 -1
- package/node_modules/@contrast/library-analysis/lib/util.js +0 -2
- package/node_modules/@contrast/library-analysis/package.json +4 -4
- package/node_modules/@contrast/logger/package.json +3 -3
- package/node_modules/@contrast/metrics/package.json +6 -6
- package/node_modules/@contrast/patcher/package.json +2 -2
- package/node_modules/@contrast/protect/lib/error-handlers/index.js +1 -1
- package/node_modules/@contrast/protect/lib/error-handlers/install/{koa2.js → koa.js} +4 -4
- package/node_modules/@contrast/protect/lib/index.d.ts +1 -1
- package/node_modules/@contrast/protect/lib/input-analysis/index.js +2 -3
- package/node_modules/@contrast/protect/lib/input-analysis/install/koa-bodyparsers.js +92 -0
- package/node_modules/@contrast/protect/lib/input-analysis/install/{koa2.js → koa.js} +5 -5
- package/node_modules/@contrast/protect/package.json +11 -11
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +6 -10
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/routes-observed.js +4 -0
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.d.ts +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.d.ts +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +22 -9
- package/node_modules/@contrast/reporter/lib/reporters/file.js +1 -1
- package/node_modules/@contrast/reporter/package.json +6 -6
- package/node_modules/@contrast/rewriter/package.json +5 -5
- package/node_modules/@contrast/route-coverage/lib/index.d.ts +0 -2
- package/node_modules/@contrast/route-coverage/lib/index.js +10 -1
- package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +16 -1
- package/node_modules/@contrast/route-coverage/lib/install/fastify.js +25 -15
- package/node_modules/@contrast/route-coverage/lib/install/graphql.js +6 -1
- package/node_modules/@contrast/route-coverage/lib/install/koa.js +1 -1
- package/node_modules/@contrast/route-coverage/lib/install/socket.io.js +127 -0
- package/node_modules/@contrast/route-coverage/package.json +8 -8
- package/node_modules/@contrast/scopes/package.json +5 -5
- package/node_modules/@contrast/sec-obs/package.json +9 -9
- package/node_modules/@contrast/sources/lib/index.js +65 -22
- package/node_modules/@contrast/sources/lib/index.test.js +78 -33
- package/node_modules/@contrast/sources/lib/source-info.js +1 -10
- package/node_modules/@contrast/sources/package.json +3 -3
- package/node_modules/@contrast/telemetry/package.json +5 -5
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/assert.d.ts +37 -2
- package/node_modules/@types/node/buffer.buffer.d.ts +9 -0
- package/node_modules/@types/node/buffer.d.ts +8 -4
- package/node_modules/@types/node/child_process.d.ts +65 -42
- package/node_modules/@types/node/cluster.d.ts +4 -5
- package/node_modules/@types/node/crypto.d.ts +1079 -338
- package/node_modules/@types/node/dgram.d.ts +9 -8
- package/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
- package/node_modules/@types/node/dns.d.ts +1 -1
- package/node_modules/@types/node/events.d.ts +1 -1
- package/node_modules/@types/node/fs/promises.d.ts +39 -21
- package/node_modules/@types/node/fs.d.ts +104 -87
- package/node_modules/@types/node/globals.d.ts +2 -0
- package/node_modules/@types/node/globals.typedarray.d.ts +19 -0
- package/node_modules/@types/node/http.d.ts +66 -27
- package/node_modules/@types/node/http2.d.ts +178 -52
- package/node_modules/@types/node/https.d.ts +91 -62
- package/node_modules/@types/node/index.d.ts +2 -0
- package/node_modules/@types/node/inspector.d.ts +24 -0
- package/node_modules/@types/node/inspector.generated.d.ts +181 -0
- package/node_modules/@types/node/net.d.ts +12 -11
- package/node_modules/@types/node/os.d.ts +14 -3
- package/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/node/perf_hooks.d.ts +6 -8
- package/node_modules/@types/node/process.d.ts +12 -23
- package/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/node_modules/@types/node/sea.d.ts +9 -0
- package/node_modules/@types/node/sqlite.d.ts +119 -10
- package/node_modules/@types/node/stream/consumers.d.ts +2 -2
- package/node_modules/@types/node/stream/web.d.ts +6 -55
- package/node_modules/@types/node/stream.d.ts +38 -23
- package/node_modules/@types/node/string_decoder.d.ts +2 -2
- package/node_modules/@types/node/test.d.ts +29 -3
- package/node_modules/@types/node/tls.d.ts +90 -66
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +10 -2
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +16 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +2 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +2 -0
- package/node_modules/@types/node/url.d.ts +2 -2
- package/node_modules/@types/node/util.d.ts +12 -3
- package/node_modules/@types/node/v8.d.ts +38 -5
- package/node_modules/@types/node/vm.d.ts +169 -88
- package/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/node_modules/@types/node/worker_threads.d.ts +76 -1
- package/node_modules/@types/node/zlib.d.ts +25 -24
- package/node_modules/axios/CHANGELOG.md +403 -357
- package/node_modules/axios/README.md +80 -49
- package/node_modules/axios/dist/axios.js +121 -46
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +126 -57
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +126 -57
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +346 -97
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +4 -0
- package/node_modules/axios/index.d.ts +4 -0
- package/node_modules/axios/lib/adapters/adapters.js +85 -40
- package/node_modules/axios/lib/adapters/fetch.js +1 -1
- package/node_modules/axios/lib/adapters/http.js +220 -42
- package/node_modules/axios/lib/core/InterceptorManager.js +1 -1
- package/node_modules/axios/lib/core/mergeConfig.js +4 -4
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +6 -0
- package/node_modules/axios/lib/helpers/bind.js +7 -0
- package/node_modules/axios/lib/helpers/cookies.js +24 -13
- package/node_modules/axios/package.json +9 -4
- package/node_modules/detect-libc/lib/filesystem.js +1 -1
- package/node_modules/detect-libc/package.json +3 -1
- package/node_modules/node-abi/abi_registry.json +12 -2
- package/node_modules/node-abi/package.json +3 -6
- package/node_modules/semver/classes/range.js +1 -0
- package/node_modules/semver/classes/semver.js +19 -5
- package/node_modules/semver/internal/identifiers.js +4 -0
- package/node_modules/semver/package.json +3 -3
- package/node_modules/undici-types/agent.d.ts +1 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +0 -1
- package/node_modules/undici-types/errors.d.ts +5 -15
- package/node_modules/undici-types/eventsource.d.ts +6 -1
- package/node_modules/undici-types/index.d.ts +4 -1
- package/node_modules/undici-types/interceptors.d.ts +5 -0
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/snapshot-agent.d.ts +5 -3
- package/node_modules/undici-types/webidl.d.ts +82 -21
- package/package.json +3 -3
- package/node_modules/@contrast/protect/lib/input-analysis/install/koa-body5.js +0 -63
- package/node_modules/@contrast/protect/lib/input-analysis/install/koa-bodyparser4.js +0 -64
|
@@ -8,6 +8,38 @@ const mocks = require('@contrast/test/mocks');
|
|
|
8
8
|
const proxyquire = require('proxyquire');
|
|
9
9
|
|
|
10
10
|
describe('agentify sources', function () {
|
|
11
|
+
let core, api, ServerMock, reqMock, resMock, onFinishedMock;
|
|
12
|
+
|
|
13
|
+
beforeEach(function () {
|
|
14
|
+
({ core } = initProtectFixture());
|
|
15
|
+
ServerMock = function ServerMock() {
|
|
16
|
+
this.e = new EventEmitter();
|
|
17
|
+
};
|
|
18
|
+
ServerMock.prototype.emit = function (...args) {
|
|
19
|
+
this.e.emit(...args);
|
|
20
|
+
};
|
|
21
|
+
ServerMock.prototype.on = function (...args) {
|
|
22
|
+
this.e.on(...args);
|
|
23
|
+
};
|
|
24
|
+
api = {
|
|
25
|
+
Server: ServerMock,
|
|
26
|
+
createServer() {
|
|
27
|
+
return new ServerMock();
|
|
28
|
+
},
|
|
29
|
+
createSecureServer() {
|
|
30
|
+
return new ServerMock();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
reqMock = mocks.incomingMessage();
|
|
34
|
+
// resMock = new EventEmitter();
|
|
35
|
+
onFinishedMock = sinon.stub();
|
|
36
|
+
|
|
37
|
+
core.depHooks.resolve.withArgs(sinon.match({ name: 'http' })).yields(api);
|
|
38
|
+
proxyquire('.', {
|
|
39
|
+
'on-finished': onFinishedMock,
|
|
40
|
+
})(core).install();
|
|
41
|
+
});
|
|
42
|
+
|
|
11
43
|
[
|
|
12
44
|
{
|
|
13
45
|
name: 'http',
|
|
@@ -24,41 +56,9 @@ describe('agentify sources', function () {
|
|
|
24
56
|
protocol: 'https',
|
|
25
57
|
serverType: 'https',
|
|
26
58
|
},
|
|
27
|
-
}
|
|
59
|
+
},
|
|
28
60
|
].forEach(({ name, method, expected }) => {
|
|
29
61
|
describe(`${name} sources using ${method || 'Server'}()`, function () {
|
|
30
|
-
let core, api, ServerMock, reqMock, resMock, onFinishedMock;
|
|
31
|
-
|
|
32
|
-
beforeEach(function () {
|
|
33
|
-
({ core } = initProtectFixture());
|
|
34
|
-
ServerMock = function ServerMock() {
|
|
35
|
-
this.e = new EventEmitter();
|
|
36
|
-
};
|
|
37
|
-
ServerMock.prototype.emit = function (...args) {
|
|
38
|
-
this.e.emit(...args);
|
|
39
|
-
};
|
|
40
|
-
ServerMock.prototype.on = function (...args) {
|
|
41
|
-
this.e.on(...args);
|
|
42
|
-
};
|
|
43
|
-
api = {
|
|
44
|
-
Server: ServerMock,
|
|
45
|
-
createServer() {
|
|
46
|
-
return new ServerMock();
|
|
47
|
-
},
|
|
48
|
-
createSecureServer() {
|
|
49
|
-
return new ServerMock();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
reqMock = mocks.incomingMessage();
|
|
53
|
-
// resMock = new EventEmitter();
|
|
54
|
-
onFinishedMock = sinon.stub();
|
|
55
|
-
|
|
56
|
-
core.depHooks.resolve.withArgs(sinon.match({ name: 'http' })).yields(api);
|
|
57
|
-
proxyquire('.', {
|
|
58
|
-
'on-finished': onFinishedMock,
|
|
59
|
-
})(core).install();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
62
|
it('"request" events run in scope with correct sourceInfo', function () {
|
|
63
63
|
const server = method ? api[method]() : new ServerMock();
|
|
64
64
|
let store;
|
|
@@ -88,7 +88,52 @@ describe('agentify sources', function () {
|
|
|
88
88
|
|
|
89
89
|
server.emit('foo', reqMock, resMock);
|
|
90
90
|
expect(store).to.be.undefined;
|
|
91
|
+
expect(onFinishedMock).not.to.have.been.called;
|
|
91
92
|
});
|
|
92
93
|
});
|
|
93
94
|
});
|
|
95
|
+
|
|
96
|
+
it('"upgrade" events run in scope with correct sourceInfo', function () {
|
|
97
|
+
const server = new ServerMock();
|
|
98
|
+
const socketMock = new EventEmitter();
|
|
99
|
+
let store;
|
|
100
|
+
let socketEventStore;
|
|
101
|
+
|
|
102
|
+
reqMock.rawHeaders.push('upgrade', 'websocket');
|
|
103
|
+
|
|
104
|
+
server.on('upgrade', function () {
|
|
105
|
+
store = core.scopes.sources.getStore();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
server.emit('upgrade', reqMock, socketMock);
|
|
109
|
+
|
|
110
|
+
expect(store.sourceInfo).to.deep.include({
|
|
111
|
+
port: 8080,
|
|
112
|
+
protocol: 'http',
|
|
113
|
+
serverType: 'http',
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
socketMock.on('some-message', function() {
|
|
117
|
+
socketEventStore = core.scopes.sources.getStore();
|
|
118
|
+
});
|
|
119
|
+
socketMock.emit('some-message');
|
|
120
|
+
|
|
121
|
+
expect(store).to.equal(socketEventStore);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('"upgrade" events do not run in scope if not "websocket"', function () {
|
|
125
|
+
const server = new ServerMock();
|
|
126
|
+
const socketMock = new EventEmitter();
|
|
127
|
+
let store;
|
|
128
|
+
|
|
129
|
+
reqMock.rawHeaders.push('upgrade', 'h2c');
|
|
130
|
+
|
|
131
|
+
server.on('upgrade', function () {
|
|
132
|
+
store = core.scopes.sources.getStore();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
server.emit('upgrade', reqMock, socketMock);
|
|
136
|
+
|
|
137
|
+
expect(store).to.be.undefined;
|
|
138
|
+
});
|
|
94
139
|
});
|
|
@@ -53,7 +53,7 @@ class HttpSourceInfo {
|
|
|
53
53
|
this.httpVersion = raw.httpVersion;
|
|
54
54
|
this.ip = raw.socket.remoteAddress ? StringPrototypeReplace.call(raw.socket.remoteAddress, /::ffff:/, '') : undefined;
|
|
55
55
|
this.port = raw.socket.address?.()?.port || 0;
|
|
56
|
-
this.protocol = serverType == 'http' ? 'http' : 'https';
|
|
56
|
+
this.protocol = serverType == 'http' ? 'http' : 'https';
|
|
57
57
|
this.serverType = serverType;
|
|
58
58
|
this.time = Date.now();
|
|
59
59
|
this.method = StringPrototypeToLowerCase.call(raw.method);
|
|
@@ -62,20 +62,11 @@ class HttpSourceInfo {
|
|
|
62
62
|
for (let i = 0; i < raw.rawHeaders.length; i += 2) {
|
|
63
63
|
const iNext = i + 1;
|
|
64
64
|
const headerName = StringPrototypeToLowerCase.call(raw.rawHeaders[i]);
|
|
65
|
-
|
|
66
65
|
headerName == 'content-type' && (this.contentType = raw.rawHeaders[iNext]);
|
|
67
|
-
|
|
68
66
|
this.rawHeaders[i] = headerName;
|
|
69
67
|
this.rawHeaders[iNext] = headerName == 'content-type' ?
|
|
70
68
|
StringPrototypeToLowerCase.call(raw.rawHeaders[iNext]) :
|
|
71
69
|
raw.rawHeaders[iNext];
|
|
72
|
-
|
|
73
|
-
if (
|
|
74
|
-
headerName == 'upgrade' &&
|
|
75
|
-
StringPrototypeToLowerCase.call(this.rawHeaders[iNext]) == 'websocket'
|
|
76
|
-
) {
|
|
77
|
-
this.protocol = 'ws';
|
|
78
|
-
}
|
|
79
70
|
}
|
|
80
71
|
|
|
81
72
|
const idx = raw.url.indexOf('?');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/sources",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Instruments to have incoming messages run in async-local request scope.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"author": "",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@contrast/common": "1.
|
|
13
|
-
"@contrast/core": "1.
|
|
12
|
+
"@contrast/common": "1.38.0",
|
|
13
|
+
"@contrast/core": "1.59.0",
|
|
14
14
|
"on-finished": "^2.4.1"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/telemetry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.0",
|
|
4
4
|
"description": "Telemetry reporting for the Contrast Node.js agent.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"test": "bash ../scripts/test.sh"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@contrast/common": "1.
|
|
23
|
-
"@contrast/config": "1.
|
|
24
|
-
"@contrast/core": "1.
|
|
25
|
-
"@contrast/logger": "1.
|
|
22
|
+
"@contrast/common": "1.38.0",
|
|
23
|
+
"@contrast/config": "1.54.0",
|
|
24
|
+
"@contrast/core": "1.59.0",
|
|
25
|
+
"@contrast/logger": "1.32.0",
|
|
26
26
|
"axios": "^1.12.2",
|
|
27
27
|
"getmac": "^6.3.0"
|
|
28
28
|
}
|
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Tue, 28 Oct 2025 17:37:26 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -44,6 +44,13 @@ declare module "assert" {
|
|
|
44
44
|
* @default true
|
|
45
45
|
*/
|
|
46
46
|
strict?: boolean | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* If set to `true`, skips prototype and constructor
|
|
49
|
+
* comparison in deep equality checks.
|
|
50
|
+
* @since v24.9.0
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
skipPrototype?: boolean | undefined;
|
|
47
54
|
}
|
|
48
55
|
interface Assert extends Pick<typeof assert, AssertMethodNames> {
|
|
49
56
|
readonly [kOptions]: AssertOptions & { strict: false };
|
|
@@ -67,7 +74,8 @@ declare module "assert" {
|
|
|
67
74
|
* ```
|
|
68
75
|
*
|
|
69
76
|
* **Important**: When destructuring assertion methods from an `Assert` instance,
|
|
70
|
-
* the methods lose their connection to the instance's configuration options (such
|
|
77
|
+
* the methods lose their connection to the instance's configuration options (such
|
|
78
|
+
* as `diff`, `strict`, and `skipPrototype` settings).
|
|
71
79
|
* The destructured methods will fall back to default behavior instead.
|
|
72
80
|
*
|
|
73
81
|
* ```js
|
|
@@ -81,6 +89,33 @@ declare module "assert" {
|
|
|
81
89
|
* strictEqual({ a: 1 }, { b: { c: 1 } });
|
|
82
90
|
* ```
|
|
83
91
|
*
|
|
92
|
+
* The `skipPrototype` option affects all deep equality methods:
|
|
93
|
+
*
|
|
94
|
+
* ```js
|
|
95
|
+
* class Foo {
|
|
96
|
+
* constructor(a) {
|
|
97
|
+
* this.a = a;
|
|
98
|
+
* }
|
|
99
|
+
* }
|
|
100
|
+
*
|
|
101
|
+
* class Bar {
|
|
102
|
+
* constructor(a) {
|
|
103
|
+
* this.a = a;
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
*
|
|
107
|
+
* const foo = new Foo(1);
|
|
108
|
+
* const bar = new Bar(1);
|
|
109
|
+
*
|
|
110
|
+
* // Default behavior - fails due to different constructors
|
|
111
|
+
* const assert1 = new Assert();
|
|
112
|
+
* assert1.deepStrictEqual(foo, bar); // AssertionError
|
|
113
|
+
*
|
|
114
|
+
* // Skip prototype comparison - passes if properties are equal
|
|
115
|
+
* const assert2 = new Assert({ skipPrototype: true });
|
|
116
|
+
* assert2.deepStrictEqual(foo, bar); // OK
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
84
119
|
* When destructured, methods lose access to the instance's `this` context and revert to default assertion behavior
|
|
85
120
|
* (diff: 'simple', non-strict mode).
|
|
86
121
|
* To maintain custom options when using destructured methods, avoid
|
|
@@ -88,7 +123,7 @@ declare module "assert" {
|
|
|
88
123
|
* @since v24.6.0
|
|
89
124
|
*/
|
|
90
125
|
new(
|
|
91
|
-
options?: AssertOptions & { strict?: true },
|
|
126
|
+
options?: AssertOptions & { strict?: true | undefined },
|
|
92
127
|
): AssertStrict;
|
|
93
128
|
new(
|
|
94
129
|
options: AssertOptions,
|
|
@@ -451,7 +451,16 @@ declare module "buffer" {
|
|
|
451
451
|
*/
|
|
452
452
|
subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
|
|
453
453
|
}
|
|
454
|
+
// TODO: remove globals in future version
|
|
455
|
+
/**
|
|
456
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
457
|
+
* TypeScript versions earlier than 5.7.
|
|
458
|
+
*/
|
|
454
459
|
type NonSharedBuffer = Buffer<ArrayBuffer>;
|
|
460
|
+
/**
|
|
461
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
462
|
+
* TypeScript versions earlier than 5.7.
|
|
463
|
+
*/
|
|
455
464
|
type AllowSharedBuffer = Buffer<ArrayBufferLike>;
|
|
456
465
|
}
|
|
457
466
|
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
@@ -59,7 +59,7 @@ declare module "buffer" {
|
|
|
59
59
|
* @since v19.4.0, v18.14.0
|
|
60
60
|
* @param input The input to validate.
|
|
61
61
|
*/
|
|
62
|
-
export function isUtf8(input:
|
|
62
|
+
export function isUtf8(input: ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
63
63
|
/**
|
|
64
64
|
* This function returns `true` if `input` contains only valid ASCII-encoded data,
|
|
65
65
|
* including the case in which `input` is empty.
|
|
@@ -68,7 +68,7 @@ declare module "buffer" {
|
|
|
68
68
|
* @since v19.6.0, v18.15.0
|
|
69
69
|
* @param input The input to validate.
|
|
70
70
|
*/
|
|
71
|
-
export function isAscii(input:
|
|
71
|
+
export function isAscii(input: ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
72
72
|
export let INSPECT_MAX_BYTES: number;
|
|
73
73
|
export const kMaxLength: number;
|
|
74
74
|
export const kStringMaxLength: number;
|
|
@@ -113,7 +113,11 @@ declare module "buffer" {
|
|
|
113
113
|
* @param fromEnc The current encoding.
|
|
114
114
|
* @param toEnc To target encoding.
|
|
115
115
|
*/
|
|
116
|
-
export function transcode(
|
|
116
|
+
export function transcode(
|
|
117
|
+
source: Uint8Array,
|
|
118
|
+
fromEnc: TranscodeEncoding,
|
|
119
|
+
toEnc: TranscodeEncoding,
|
|
120
|
+
): NonSharedBuffer;
|
|
117
121
|
/**
|
|
118
122
|
* Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
|
|
119
123
|
* a prior call to `URL.createObjectURL()`.
|
|
@@ -330,7 +334,7 @@ declare module "buffer" {
|
|
|
330
334
|
* @return The number of bytes contained within `string`.
|
|
331
335
|
*/
|
|
332
336
|
byteLength(
|
|
333
|
-
string: string |
|
|
337
|
+
string: string | NodeJS.ArrayBufferView | ArrayBufferLike,
|
|
334
338
|
encoding?: BufferEncoding,
|
|
335
339
|
): number;
|
|
336
340
|
/**
|
|
@@ -66,10 +66,11 @@
|
|
|
66
66
|
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/child_process.js)
|
|
67
67
|
*/
|
|
68
68
|
declare module "child_process" {
|
|
69
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
69
70
|
import { Abortable, EventEmitter } from "node:events";
|
|
70
71
|
import * as dgram from "node:dgram";
|
|
71
72
|
import * as net from "node:net";
|
|
72
|
-
import {
|
|
73
|
+
import { Readable, Stream, Writable } from "node:stream";
|
|
73
74
|
import { URL } from "node:url";
|
|
74
75
|
type Serializable = string | object | number | boolean | bigint;
|
|
75
76
|
type SendHandle = net.Socket | net.Server | dgram.Socket | undefined;
|
|
@@ -139,7 +140,7 @@ declare module "child_process" {
|
|
|
139
140
|
* no IPC channel exists, this property is `undefined`.
|
|
140
141
|
* @since v7.1.0
|
|
141
142
|
*/
|
|
142
|
-
readonly channel?:
|
|
143
|
+
readonly channel?: Control | null;
|
|
143
144
|
/**
|
|
144
145
|
* A sparse array of pipes to the child process, corresponding with positions in
|
|
145
146
|
* the `stdio` option passed to {@link spawn} that have been set
|
|
@@ -612,6 +613,10 @@ declare module "child_process" {
|
|
|
612
613
|
Readable | Writable | null | undefined, // extra, no modification
|
|
613
614
|
];
|
|
614
615
|
}
|
|
616
|
+
interface Control extends EventEmitter {
|
|
617
|
+
ref(): void;
|
|
618
|
+
unref(): void;
|
|
619
|
+
}
|
|
615
620
|
interface MessageOptions {
|
|
616
621
|
keepOpen?: boolean | undefined;
|
|
617
622
|
}
|
|
@@ -894,11 +899,12 @@ declare module "child_process" {
|
|
|
894
899
|
interface ExecOptionsWithBufferEncoding extends ExecOptions {
|
|
895
900
|
encoding: "buffer" | null; // specify `null`.
|
|
896
901
|
}
|
|
902
|
+
// TODO: Just Plain Wrong™ (see also nodejs/node#57392)
|
|
897
903
|
interface ExecException extends Error {
|
|
898
|
-
cmd?: string
|
|
899
|
-
killed?: boolean
|
|
900
|
-
code?: number
|
|
901
|
-
signal?: NodeJS.Signals
|
|
904
|
+
cmd?: string;
|
|
905
|
+
killed?: boolean;
|
|
906
|
+
code?: number;
|
|
907
|
+
signal?: NodeJS.Signals;
|
|
902
908
|
stdout?: string;
|
|
903
909
|
stderr?: string;
|
|
904
910
|
}
|
|
@@ -996,7 +1002,7 @@ declare module "child_process" {
|
|
|
996
1002
|
function exec(
|
|
997
1003
|
command: string,
|
|
998
1004
|
options: ExecOptionsWithBufferEncoding,
|
|
999
|
-
callback?: (error: ExecException | null, stdout:
|
|
1005
|
+
callback?: (error: ExecException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
|
|
1000
1006
|
): ChildProcess;
|
|
1001
1007
|
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
|
1002
1008
|
function exec(
|
|
@@ -1008,7 +1014,11 @@ declare module "child_process" {
|
|
|
1008
1014
|
function exec(
|
|
1009
1015
|
command: string,
|
|
1010
1016
|
options: ExecOptions | undefined | null,
|
|
1011
|
-
callback?: (
|
|
1017
|
+
callback?: (
|
|
1018
|
+
error: ExecException | null,
|
|
1019
|
+
stdout: string | NonSharedBuffer,
|
|
1020
|
+
stderr: string | NonSharedBuffer,
|
|
1021
|
+
) => void,
|
|
1012
1022
|
): ChildProcess;
|
|
1013
1023
|
interface PromiseWithChild<T> extends Promise<T> {
|
|
1014
1024
|
child: ChildProcess;
|
|
@@ -1022,8 +1032,8 @@ declare module "child_process" {
|
|
|
1022
1032
|
command: string,
|
|
1023
1033
|
options: ExecOptionsWithBufferEncoding,
|
|
1024
1034
|
): PromiseWithChild<{
|
|
1025
|
-
stdout:
|
|
1026
|
-
stderr:
|
|
1035
|
+
stdout: NonSharedBuffer;
|
|
1036
|
+
stderr: NonSharedBuffer;
|
|
1027
1037
|
}>;
|
|
1028
1038
|
function __promisify__(
|
|
1029
1039
|
command: string,
|
|
@@ -1036,8 +1046,8 @@ declare module "child_process" {
|
|
|
1036
1046
|
command: string,
|
|
1037
1047
|
options: ExecOptions | undefined | null,
|
|
1038
1048
|
): PromiseWithChild<{
|
|
1039
|
-
stdout: string |
|
|
1040
|
-
stderr: string |
|
|
1049
|
+
stdout: string | NonSharedBuffer;
|
|
1050
|
+
stderr: string | NonSharedBuffer;
|
|
1041
1051
|
}>;
|
|
1042
1052
|
}
|
|
1043
1053
|
interface ExecFileOptions extends CommonOptions, Abortable {
|
|
@@ -1056,10 +1066,11 @@ declare module "child_process" {
|
|
|
1056
1066
|
}
|
|
1057
1067
|
/** @deprecated Use `ExecFileOptions` instead. */
|
|
1058
1068
|
interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {}
|
|
1069
|
+
// TODO: execFile exceptions can take many forms... this accurately describes none of them
|
|
1059
1070
|
type ExecFileException =
|
|
1060
1071
|
& Omit<ExecException, "code">
|
|
1061
1072
|
& Omit<NodeJS.ErrnoException, "code">
|
|
1062
|
-
& { code?: string | number |
|
|
1073
|
+
& { code?: string | number | null };
|
|
1063
1074
|
/**
|
|
1064
1075
|
* The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
|
|
1065
1076
|
* executable `file` is spawned directly as a new process making it slightly more
|
|
@@ -1138,13 +1149,13 @@ declare module "child_process" {
|
|
|
1138
1149
|
function execFile(
|
|
1139
1150
|
file: string,
|
|
1140
1151
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1141
|
-
callback?: (error: ExecFileException | null, stdout:
|
|
1152
|
+
callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
|
|
1142
1153
|
): ChildProcess;
|
|
1143
1154
|
function execFile(
|
|
1144
1155
|
file: string,
|
|
1145
1156
|
args: readonly string[] | undefined | null,
|
|
1146
1157
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1147
|
-
callback?: (error: ExecFileException | null, stdout:
|
|
1158
|
+
callback?: (error: ExecFileException | null, stdout: NonSharedBuffer, stderr: NonSharedBuffer) => void,
|
|
1148
1159
|
): ChildProcess;
|
|
1149
1160
|
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
|
1150
1161
|
function execFile(
|
|
@@ -1163,7 +1174,11 @@ declare module "child_process" {
|
|
|
1163
1174
|
file: string,
|
|
1164
1175
|
options: ExecFileOptions | undefined | null,
|
|
1165
1176
|
callback:
|
|
1166
|
-
| ((
|
|
1177
|
+
| ((
|
|
1178
|
+
error: ExecFileException | null,
|
|
1179
|
+
stdout: string | NonSharedBuffer,
|
|
1180
|
+
stderr: string | NonSharedBuffer,
|
|
1181
|
+
) => void)
|
|
1167
1182
|
| undefined
|
|
1168
1183
|
| null,
|
|
1169
1184
|
): ChildProcess;
|
|
@@ -1172,7 +1187,11 @@ declare module "child_process" {
|
|
|
1172
1187
|
args: readonly string[] | undefined | null,
|
|
1173
1188
|
options: ExecFileOptions | undefined | null,
|
|
1174
1189
|
callback:
|
|
1175
|
-
| ((
|
|
1190
|
+
| ((
|
|
1191
|
+
error: ExecFileException | null,
|
|
1192
|
+
stdout: string | NonSharedBuffer,
|
|
1193
|
+
stderr: string | NonSharedBuffer,
|
|
1194
|
+
) => void)
|
|
1176
1195
|
| undefined
|
|
1177
1196
|
| null,
|
|
1178
1197
|
): ChildProcess;
|
|
@@ -1192,16 +1211,16 @@ declare module "child_process" {
|
|
|
1192
1211
|
file: string,
|
|
1193
1212
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1194
1213
|
): PromiseWithChild<{
|
|
1195
|
-
stdout:
|
|
1196
|
-
stderr:
|
|
1214
|
+
stdout: NonSharedBuffer;
|
|
1215
|
+
stderr: NonSharedBuffer;
|
|
1197
1216
|
}>;
|
|
1198
1217
|
function __promisify__(
|
|
1199
1218
|
file: string,
|
|
1200
1219
|
args: readonly string[] | undefined | null,
|
|
1201
1220
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1202
1221
|
): PromiseWithChild<{
|
|
1203
|
-
stdout:
|
|
1204
|
-
stderr:
|
|
1222
|
+
stdout: NonSharedBuffer;
|
|
1223
|
+
stderr: NonSharedBuffer;
|
|
1205
1224
|
}>;
|
|
1206
1225
|
function __promisify__(
|
|
1207
1226
|
file: string,
|
|
@@ -1222,16 +1241,16 @@ declare module "child_process" {
|
|
|
1222
1241
|
file: string,
|
|
1223
1242
|
options: ExecFileOptions | undefined | null,
|
|
1224
1243
|
): PromiseWithChild<{
|
|
1225
|
-
stdout: string |
|
|
1226
|
-
stderr: string |
|
|
1244
|
+
stdout: string | NonSharedBuffer;
|
|
1245
|
+
stderr: string | NonSharedBuffer;
|
|
1227
1246
|
}>;
|
|
1228
1247
|
function __promisify__(
|
|
1229
1248
|
file: string,
|
|
1230
1249
|
args: readonly string[] | undefined | null,
|
|
1231
1250
|
options: ExecFileOptions | undefined | null,
|
|
1232
1251
|
): PromiseWithChild<{
|
|
1233
|
-
stdout: string |
|
|
1234
|
-
stderr: string |
|
|
1252
|
+
stdout: string | NonSharedBuffer;
|
|
1253
|
+
stderr: string | NonSharedBuffer;
|
|
1235
1254
|
}>;
|
|
1236
1255
|
}
|
|
1237
1256
|
interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
|
|
@@ -1320,7 +1339,7 @@ declare module "child_process" {
|
|
|
1320
1339
|
stderr: T;
|
|
1321
1340
|
status: number | null;
|
|
1322
1341
|
signal: NodeJS.Signals | null;
|
|
1323
|
-
error?: Error
|
|
1342
|
+
error?: Error;
|
|
1324
1343
|
}
|
|
1325
1344
|
/**
|
|
1326
1345
|
* The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
|
|
@@ -1337,11 +1356,11 @@ declare module "child_process" {
|
|
|
1337
1356
|
* @param command The command to run.
|
|
1338
1357
|
* @param args List of string arguments.
|
|
1339
1358
|
*/
|
|
1340
|
-
function spawnSync(command: string): SpawnSyncReturns<
|
|
1359
|
+
function spawnSync(command: string): SpawnSyncReturns<NonSharedBuffer>;
|
|
1341
1360
|
function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
|
1342
|
-
function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<
|
|
1343
|
-
function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string |
|
|
1344
|
-
function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<
|
|
1361
|
+
function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<NonSharedBuffer>;
|
|
1362
|
+
function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | NonSharedBuffer>;
|
|
1363
|
+
function spawnSync(command: string, args: readonly string[]): SpawnSyncReturns<NonSharedBuffer>;
|
|
1345
1364
|
function spawnSync(
|
|
1346
1365
|
command: string,
|
|
1347
1366
|
args: readonly string[],
|
|
@@ -1351,12 +1370,12 @@ declare module "child_process" {
|
|
|
1351
1370
|
command: string,
|
|
1352
1371
|
args: readonly string[],
|
|
1353
1372
|
options: SpawnSyncOptionsWithBufferEncoding,
|
|
1354
|
-
): SpawnSyncReturns<
|
|
1373
|
+
): SpawnSyncReturns<NonSharedBuffer>;
|
|
1355
1374
|
function spawnSync(
|
|
1356
1375
|
command: string,
|
|
1357
1376
|
args?: readonly string[],
|
|
1358
1377
|
options?: SpawnSyncOptions,
|
|
1359
|
-
): SpawnSyncReturns<string |
|
|
1378
|
+
): SpawnSyncReturns<string | NonSharedBuffer>;
|
|
1360
1379
|
interface CommonExecOptions extends CommonOptions {
|
|
1361
1380
|
input?: string | NodeJS.ArrayBufferView | undefined;
|
|
1362
1381
|
/**
|
|
@@ -1398,10 +1417,10 @@ declare module "child_process" {
|
|
|
1398
1417
|
* @param command The command to run.
|
|
1399
1418
|
* @return The stdout from the command.
|
|
1400
1419
|
*/
|
|
1401
|
-
function execSync(command: string):
|
|
1420
|
+
function execSync(command: string): NonSharedBuffer;
|
|
1402
1421
|
function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
|
|
1403
|
-
function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding):
|
|
1404
|
-
function execSync(command: string, options?: ExecSyncOptions): string |
|
|
1422
|
+
function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): NonSharedBuffer;
|
|
1423
|
+
function execSync(command: string, options?: ExecSyncOptions): string | NonSharedBuffer;
|
|
1405
1424
|
interface ExecFileSyncOptions extends CommonExecOptions {
|
|
1406
1425
|
shell?: boolean | string | undefined;
|
|
1407
1426
|
}
|
|
@@ -1409,7 +1428,7 @@ declare module "child_process" {
|
|
|
1409
1428
|
encoding: BufferEncoding;
|
|
1410
1429
|
}
|
|
1411
1430
|
interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
|
1412
|
-
encoding?: "buffer" | null; // specify `null`.
|
|
1431
|
+
encoding?: "buffer" | null | undefined; // specify `null`.
|
|
1413
1432
|
}
|
|
1414
1433
|
/**
|
|
1415
1434
|
* The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
|
|
@@ -1431,11 +1450,11 @@ declare module "child_process" {
|
|
|
1431
1450
|
* @param args List of string arguments.
|
|
1432
1451
|
* @return The stdout from the command.
|
|
1433
1452
|
*/
|
|
1434
|
-
function execFileSync(file: string):
|
|
1453
|
+
function execFileSync(file: string): NonSharedBuffer;
|
|
1435
1454
|
function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string;
|
|
1436
|
-
function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding):
|
|
1437
|
-
function execFileSync(file: string, options?: ExecFileSyncOptions): string |
|
|
1438
|
-
function execFileSync(file: string, args: readonly string[]):
|
|
1455
|
+
function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): NonSharedBuffer;
|
|
1456
|
+
function execFileSync(file: string, options?: ExecFileSyncOptions): string | NonSharedBuffer;
|
|
1457
|
+
function execFileSync(file: string, args: readonly string[]): NonSharedBuffer;
|
|
1439
1458
|
function execFileSync(
|
|
1440
1459
|
file: string,
|
|
1441
1460
|
args: readonly string[],
|
|
@@ -1445,8 +1464,12 @@ declare module "child_process" {
|
|
|
1445
1464
|
file: string,
|
|
1446
1465
|
args: readonly string[],
|
|
1447
1466
|
options: ExecFileSyncOptionsWithBufferEncoding,
|
|
1448
|
-
):
|
|
1449
|
-
function execFileSync(
|
|
1467
|
+
): NonSharedBuffer;
|
|
1468
|
+
function execFileSync(
|
|
1469
|
+
file: string,
|
|
1470
|
+
args?: readonly string[],
|
|
1471
|
+
options?: ExecFileSyncOptions,
|
|
1472
|
+
): string | NonSharedBuffer;
|
|
1450
1473
|
}
|
|
1451
1474
|
declare module "node:child_process" {
|
|
1452
1475
|
export * from "child_process";
|
|
@@ -72,7 +72,7 @@ declare module "cluster" {
|
|
|
72
72
|
* String arguments passed to worker.
|
|
73
73
|
* @default process.argv.slice(2)
|
|
74
74
|
*/
|
|
75
|
-
args?: string[] | undefined;
|
|
75
|
+
args?: readonly string[] | undefined;
|
|
76
76
|
/**
|
|
77
77
|
* Whether or not to send output to parent's stdio.
|
|
78
78
|
* @default false
|
|
@@ -481,7 +481,7 @@ declare module "cluster" {
|
|
|
481
481
|
* ```
|
|
482
482
|
* @since v0.7.0
|
|
483
483
|
*/
|
|
484
|
-
readonly worker?: Worker
|
|
484
|
+
readonly worker?: Worker;
|
|
485
485
|
/**
|
|
486
486
|
* A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process.
|
|
487
487
|
*
|
|
@@ -497,7 +497,7 @@ declare module "cluster" {
|
|
|
497
497
|
* ```
|
|
498
498
|
* @since v0.7.0
|
|
499
499
|
*/
|
|
500
|
-
readonly workers?: NodeJS.Dict<Worker
|
|
500
|
+
readonly workers?: NodeJS.Dict<Worker>;
|
|
501
501
|
readonly SCHED_NONE: number;
|
|
502
502
|
readonly SCHED_RR: number;
|
|
503
503
|
/**
|
|
@@ -550,10 +550,9 @@ declare module "cluster" {
|
|
|
550
550
|
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
551
551
|
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
|
552
552
|
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
553
|
-
// the handle is a net.Socket or net.Server object, or undefined.
|
|
554
553
|
prependListener(
|
|
555
554
|
event: "message",
|
|
556
|
-
listener: (worker: Worker, message: any, handle
|
|
555
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
557
556
|
): this;
|
|
558
557
|
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
|
559
558
|
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|