@datadog/pprof 6.0.0-pre-fdd7f20 → 6.0.0-pre-90fbe2b
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 +2 -6
- package/out/src/async-context-frame.d.ts +48 -0
- package/out/src/async-context-frame.js +106 -0
- package/out/src/async-context-frame.js.map +1 -0
- package/out/src/heap-profiler-bindings.d.ts +4 -3
- package/out/src/heap-profiler-bindings.js +8 -4
- package/out/src/heap-profiler-bindings.js.map +1 -1
- package/out/src/heap-profiler.d.ts +48 -21
- package/out/src/heap-profiler.js +103 -31
- package/out/src/heap-profiler.js.map +1 -1
- package/out/src/index.d.ts +10 -0
- package/out/src/index.js +14 -1
- package/out/src/index.js.map +1 -1
- package/out/src/otel-thread-ctx.d.ts +109 -0
- package/out/src/otel-thread-ctx.js +166 -0
- package/out/src/otel-thread-ctx.js.map +1 -0
- package/out/src/profile-serializer.d.ts +26 -3
- package/out/src/profile-serializer.js +110 -26
- package/out/src/profile-serializer.js.map +1 -1
- package/out/src/sourcemapper/sourcemapper.d.ts +38 -7
- package/out/src/sourcemapper/sourcemapper.js +265 -75
- package/out/src/sourcemapper/sourcemapper.js.map +1 -1
- package/out/src/time-profiler.d.ts +21 -3
- package/out/src/time-profiler.js +63 -20
- package/out/src/time-profiler.js.map +1 -1
- package/out/src/v8-types.d.ts +12 -0
- package/package.json +44 -23
- package/prebuilds/darwin-arm64/dd_pprof.node.abi108.node +0 -0
- package/prebuilds/darwin-arm64/dd_pprof.node.abi111.node +0 -0
- package/prebuilds/darwin-arm64/dd_pprof.node.abi115.node +0 -0
- package/prebuilds/darwin-arm64/dd_pprof.node.abi120.node +0 -0
- package/prebuilds/darwin-arm64/dd_pprof.node.abi127.node +0 -0
- package/prebuilds/darwin-arm64/dd_pprof.node.abi131.node +0 -0
- package/prebuilds/darwin-arm64/dd_pprof.node.abi137.node +0 -0
- package/prebuilds/darwin-arm64/dd_pprof.node.abi141.node +0 -0
- package/prebuilds/darwin-arm64/dd_pprof.node.abi147.node +0 -0
- package/prebuilds/darwin-x64/dd_pprof.node.abi108.node +0 -0
- package/prebuilds/darwin-x64/dd_pprof.node.abi111.node +0 -0
- package/prebuilds/darwin-x64/dd_pprof.node.abi115.node +0 -0
- package/prebuilds/darwin-x64/dd_pprof.node.abi120.node +0 -0
- package/prebuilds/darwin-x64/dd_pprof.node.abi127.node +0 -0
- package/prebuilds/darwin-x64/dd_pprof.node.abi131.node +0 -0
- package/prebuilds/darwin-x64/dd_pprof.node.abi137.node +0 -0
- package/prebuilds/darwin-x64/dd_pprof.node.abi141.node +0 -0
- package/prebuilds/darwin-x64/dd_pprof.node.abi147.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.musl.node.abi108.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.musl.node.abi111.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.musl.node.abi115.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.musl.node.abi120.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.musl.node.abi127.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.musl.node.abi131.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.musl.node.abi137.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.musl.node.abi141.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.musl.node.abi147.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.node.abi108.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.node.abi111.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.node.abi115.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.node.abi120.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.node.abi127.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.node.abi131.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.node.abi137.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.node.abi141.node +0 -0
- package/prebuilds/linux-arm64/dd_pprof.node.abi147.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.musl.node.abi108.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.musl.node.abi111.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.musl.node.abi115.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.musl.node.abi120.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.musl.node.abi127.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.musl.node.abi131.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.musl.node.abi137.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.musl.node.abi141.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.musl.node.abi147.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.node.abi108.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.node.abi111.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.node.abi115.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.node.abi120.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.node.abi127.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.node.abi131.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.node.abi137.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.node.abi141.node +0 -0
- package/prebuilds/linux-x64/dd_pprof.node.abi147.node +0 -0
- package/prebuilds/win32-x64/dd_pprof.node.abi108.node +0 -0
- package/prebuilds/win32-x64/dd_pprof.node.abi111.node +0 -0
- package/prebuilds/win32-x64/dd_pprof.node.abi115.node +0 -0
- package/prebuilds/win32-x64/dd_pprof.node.abi120.node +0 -0
- package/prebuilds/win32-x64/dd_pprof.node.abi127.node +0 -0
- package/prebuilds/win32-x64/dd_pprof.node.abi131.node +0 -0
- package/prebuilds/win32-x64/dd_pprof.node.abi137.node +0 -0
- package/prebuilds/win32-x64/dd_pprof.node.abi141.node +0 -0
- package/prebuilds/win32-x64/dd_pprof.node.abi147.node +0 -0
- package/prebuilds/darwin-arm64/node-108.node +0 -0
- package/prebuilds/darwin-arm64/node-111.node +0 -0
- package/prebuilds/darwin-arm64/node-115.node +0 -0
- package/prebuilds/darwin-arm64/node-120.node +0 -0
- package/prebuilds/darwin-arm64/node-127.node +0 -0
- package/prebuilds/darwin-arm64/node-131.node +0 -0
- package/prebuilds/darwin-arm64/node-137.node +0 -0
- package/prebuilds/darwin-arm64/node-141.node +0 -0
- package/prebuilds/darwin-x64/node-108.node +0 -0
- package/prebuilds/darwin-x64/node-111.node +0 -0
- package/prebuilds/darwin-x64/node-115.node +0 -0
- package/prebuilds/darwin-x64/node-120.node +0 -0
- package/prebuilds/darwin-x64/node-127.node +0 -0
- package/prebuilds/darwin-x64/node-131.node +0 -0
- package/prebuilds/darwin-x64/node-137.node +0 -0
- package/prebuilds/darwin-x64/node-141.node +0 -0
- package/prebuilds/linuxglibc-arm64/node-108.node +0 -0
- package/prebuilds/linuxglibc-arm64/node-111.node +0 -0
- package/prebuilds/linuxglibc-arm64/node-115.node +0 -0
- package/prebuilds/linuxglibc-arm64/node-120.node +0 -0
- package/prebuilds/linuxglibc-arm64/node-127.node +0 -0
- package/prebuilds/linuxglibc-arm64/node-131.node +0 -0
- package/prebuilds/linuxglibc-arm64/node-137.node +0 -0
- package/prebuilds/linuxglibc-arm64/node-141.node +0 -0
- package/prebuilds/linuxglibc-x64/node-108.node +0 -0
- package/prebuilds/linuxglibc-x64/node-111.node +0 -0
- package/prebuilds/linuxglibc-x64/node-115.node +0 -0
- package/prebuilds/linuxglibc-x64/node-120.node +0 -0
- package/prebuilds/linuxglibc-x64/node-127.node +0 -0
- package/prebuilds/linuxglibc-x64/node-131.node +0 -0
- package/prebuilds/linuxglibc-x64/node-137.node +0 -0
- package/prebuilds/linuxglibc-x64/node-141.node +0 -0
- package/prebuilds/linuxmusl-arm64/node-108.node +0 -0
- package/prebuilds/linuxmusl-arm64/node-111.node +0 -0
- package/prebuilds/linuxmusl-arm64/node-115.node +0 -0
- package/prebuilds/linuxmusl-arm64/node-120.node +0 -0
- package/prebuilds/linuxmusl-arm64/node-127.node +0 -0
- package/prebuilds/linuxmusl-arm64/node-131.node +0 -0
- package/prebuilds/linuxmusl-arm64/node-137.node +0 -0
- package/prebuilds/linuxmusl-arm64/node-141.node +0 -0
- package/prebuilds/linuxmusl-x64/node-108.node +0 -0
- package/prebuilds/linuxmusl-x64/node-111.node +0 -0
- package/prebuilds/linuxmusl-x64/node-115.node +0 -0
- package/prebuilds/linuxmusl-x64/node-120.node +0 -0
- package/prebuilds/linuxmusl-x64/node-127.node +0 -0
- package/prebuilds/linuxmusl-x64/node-131.node +0 -0
- package/prebuilds/linuxmusl-x64/node-137.node +0 -0
- package/prebuilds/linuxmusl-x64/node-141.node +0 -0
- package/prebuilds/win32-x64/node-108.node +0 -0
- package/prebuilds/win32-x64/node-111.node +0 -0
- package/prebuilds/win32-x64/node-115.node +0 -0
- package/prebuilds/win32-x64/node-120.node +0 -0
- package/prebuilds/win32-x64/node-127.node +0 -0
- package/prebuilds/win32-x64/node-131.node +0 -0
- package/prebuilds/win32-x64/node-137.node +0 -0
- package/prebuilds/win32-x64/node-141.node +0 -0
package/out/src/time-profiler.js
CHANGED
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.getNativeThreadId = exports.constants = void 0;
|
|
19
19
|
exports.profile = profile;
|
|
20
|
+
exports.profileV2 = profileV2;
|
|
20
21
|
exports.start = start;
|
|
21
22
|
exports.stop = stop;
|
|
23
|
+
exports.stopV2 = stopV2;
|
|
22
24
|
exports.getState = getState;
|
|
23
25
|
exports.setContext = setContext;
|
|
24
26
|
exports.runWithContext = runWithContext;
|
|
@@ -39,7 +41,32 @@ let gProfiler;
|
|
|
39
41
|
let gStore;
|
|
40
42
|
let gSourceMapper;
|
|
41
43
|
let gIntervalMicros;
|
|
44
|
+
let gColumnNumbers = profile_serializer_1.DEFAULT_COLUMN_NUMBERS;
|
|
42
45
|
let gV8ProfilerStuckEventLoopDetected = 0;
|
|
46
|
+
function handleStopRestart() {
|
|
47
|
+
if (!gProfiler) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
gV8ProfilerStuckEventLoopDetected =
|
|
51
|
+
gProfiler.v8ProfilerStuckEventLoopDetected();
|
|
52
|
+
// Workaround for v8 bug, where profiler event processor thread is stuck in
|
|
53
|
+
// a loop eating 100% CPU, leading to empty profiles.
|
|
54
|
+
// Fully stop and restart the profiler to reset the profile to a valid state.
|
|
55
|
+
if (gV8ProfilerStuckEventLoopDetected > 0) {
|
|
56
|
+
gProfiler.stop(false);
|
|
57
|
+
gProfiler.start();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function handleStopNoRestart() {
|
|
61
|
+
gV8ProfilerStuckEventLoopDetected = 0;
|
|
62
|
+
gProfiler?.dispose();
|
|
63
|
+
gProfiler = undefined;
|
|
64
|
+
gSourceMapper = undefined;
|
|
65
|
+
if (gStore !== undefined) {
|
|
66
|
+
gStore.disable();
|
|
67
|
+
gStore = undefined;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
43
70
|
/** Make sure to stop profiler before node shuts down, otherwise profiling
|
|
44
71
|
* signal might cause a crash if it occurs during shutdown */
|
|
45
72
|
process.once('exit', () => {
|
|
@@ -55,6 +82,7 @@ const DEFAULT_OPTIONS = {
|
|
|
55
82
|
collectCpuTime: false,
|
|
56
83
|
collectAsyncId: false,
|
|
57
84
|
useCPED: false,
|
|
85
|
+
columnNumbers: profile_serializer_1.DEFAULT_COLUMN_NUMBERS,
|
|
58
86
|
};
|
|
59
87
|
async function profile(options = {}) {
|
|
60
88
|
options = { ...DEFAULT_OPTIONS, ...options };
|
|
@@ -62,6 +90,12 @@ async function profile(options = {}) {
|
|
|
62
90
|
await (0, promises_1.setTimeout)(options.durationMillis);
|
|
63
91
|
return stop();
|
|
64
92
|
}
|
|
93
|
+
async function profileV2(options = {}) {
|
|
94
|
+
options = { ...DEFAULT_OPTIONS, ...options };
|
|
95
|
+
start(options);
|
|
96
|
+
await (0, promises_1.setTimeout)(options.durationMillis);
|
|
97
|
+
return stopV2();
|
|
98
|
+
}
|
|
65
99
|
// Temporarily retained for backwards compatibility with older tracer
|
|
66
100
|
function start(options = {}) {
|
|
67
101
|
options = { ...DEFAULT_OPTIONS, ...options };
|
|
@@ -72,6 +106,7 @@ function start(options = {}) {
|
|
|
72
106
|
gProfiler = new time_profiler_bindings_1.TimeProfiler({ ...options, CPEDKey: store, isMainThread: worker_threads_1.isMainThread });
|
|
73
107
|
gSourceMapper = options.sourceMapper;
|
|
74
108
|
gIntervalMicros = options.intervalMicros;
|
|
109
|
+
gColumnNumbers = options.columnNumbers ?? profile_serializer_1.DEFAULT_COLUMN_NUMBERS;
|
|
75
110
|
gV8ProfilerStuckEventLoopDetected = 0;
|
|
76
111
|
gProfiler.start();
|
|
77
112
|
gStore = store;
|
|
@@ -86,28 +121,36 @@ function stop(restart = false, generateLabels, lowCardinalityLabels) {
|
|
|
86
121
|
}
|
|
87
122
|
const profile = gProfiler.stop(restart);
|
|
88
123
|
if (restart) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
// Fully stop and restart the profiler to reset the profile to a valid state.
|
|
94
|
-
if (gV8ProfilerStuckEventLoopDetected > 0) {
|
|
95
|
-
gProfiler.stop(false);
|
|
96
|
-
gProfiler.start();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
gV8ProfilerStuckEventLoopDetected = 0;
|
|
124
|
+
// Restart the profiler *before* serializing so the cost of serialization is
|
|
125
|
+
// captured in the next profile. handleStopRestart() does not dispose of the
|
|
126
|
+
// source mapper, so the source-map resolution below is unaffected.
|
|
127
|
+
handleStopRestart();
|
|
101
128
|
}
|
|
102
|
-
const serializedProfile = (0, profile_serializer_1.serializeTimeProfile)(profile, gIntervalMicros, gSourceMapper, true, generateLabels, lowCardinalityLabels);
|
|
129
|
+
const serializedProfile = (0, profile_serializer_1.serializeTimeProfile)(profile, gIntervalMicros, gSourceMapper, true, generateLabels, lowCardinalityLabels, gColumnNumbers);
|
|
103
130
|
if (!restart) {
|
|
104
|
-
|
|
105
|
-
gProfiler
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
131
|
+
// Tear down *after* serializing: handleStopNoRestart() clears gSourceMapper
|
|
132
|
+
// (and disposes gProfiler), so serializing afterwards would drop source-map
|
|
133
|
+
// resolution and leave transpiled frames pointing at the generated files
|
|
134
|
+
// instead of the original sources.
|
|
135
|
+
handleStopNoRestart();
|
|
136
|
+
}
|
|
137
|
+
return serializedProfile;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Same as stop() but uses the lazy callback path: serialization happens inside
|
|
141
|
+
* a native callback while the V8 profile is still alive.
|
|
142
|
+
* This reduces memory overhead.
|
|
143
|
+
*/
|
|
144
|
+
function stopV2(restart = false, generateLabels, lowCardinalityLabels) {
|
|
145
|
+
if (!gProfiler) {
|
|
146
|
+
throw new Error('Wall profiler is not started');
|
|
147
|
+
}
|
|
148
|
+
const serializedProfile = gProfiler.stopAndCollect(restart, (profile) => (0, profile_serializer_1.serializeTimeProfile)(profile, gIntervalMicros, gSourceMapper, true, generateLabels, lowCardinalityLabels, gColumnNumbers));
|
|
149
|
+
if (restart) {
|
|
150
|
+
handleStopRestart();
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
handleStopNoRestart();
|
|
111
154
|
}
|
|
112
155
|
return serializedProfile;
|
|
113
156
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-profiler.js","sourceRoot":"","sources":["../../ts/src/time-profiler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;
|
|
1
|
+
{"version":3,"file":"time-profiler.js","sourceRoot":"","sources":["../../ts/src/time-profiler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AA0HH,0BAOC;AAED,8BAKC;AAGD,sBAoBC;AAED,oB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CAAC;IAClD,CAAC;IACD,OAAO,SAAS,CAAC,OAAO,CAAC;AAC3B,CAAC;AAED,SAAgB,UAAU;IACxB,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,SAAS,CAAC,OAA8B,CAAC;AAClD,CAAC;AAED,SAAgB,SAAS;IACvB,OAAO,CAAC,CAAC,SAAS,CAAC;AACrB,CAAC;AAED,sFAAsF;AACtF,SAAgB,gCAAgC;IAC9C,OAAO,iCAAiC,CAAC;AAC3C,CAAC;AAEY,QAAA,SAAS,GAAG;IACvB,YAAY;IACZ,gCAAgC,EAAhC,qDAAgC;IAChC,4BAA4B,EAA5B,iDAA4B;CAC7B,CAAC"}
|
package/out/src/v8-types.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export interface TimeProfile {
|
|
|
22
22
|
hasCpuTime?: boolean;
|
|
23
23
|
/** CPU time of non-JS threads, only reported for the main worker thread */
|
|
24
24
|
nonJSThreadsCpuTime?: number;
|
|
25
|
+
/** Computed in C++ to avoid a full JS tree traversal. */
|
|
26
|
+
totalHitCount?: number;
|
|
25
27
|
}
|
|
26
28
|
export interface ProfileNode {
|
|
27
29
|
name?: string;
|
|
@@ -49,6 +51,16 @@ export interface Allocation {
|
|
|
49
51
|
sizeBytes: number;
|
|
50
52
|
count: number;
|
|
51
53
|
}
|
|
54
|
+
export interface AllocationWithStats {
|
|
55
|
+
inuseObjects: number;
|
|
56
|
+
inuseSpaceBytes: number;
|
|
57
|
+
allocObjects: number;
|
|
58
|
+
allocSpaceBytes: number;
|
|
59
|
+
}
|
|
60
|
+
export interface AllocationProfileNodeWithStats extends ProfileNode {
|
|
61
|
+
allocations: AllocationWithStats[];
|
|
62
|
+
children: AllocationProfileNodeWithStats[];
|
|
63
|
+
}
|
|
52
64
|
export interface LabelSet {
|
|
53
65
|
[key: string]: string | number;
|
|
54
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datadog/pprof",
|
|
3
|
-
"version": "6.0.0-pre-
|
|
3
|
+
"version": "6.0.0-pre-90fbe2b",
|
|
4
4
|
"description": "pprof support for Node.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"main": "out/src/index.js",
|
|
10
10
|
"types": "out/src/index.d.ts",
|
|
11
|
+
"gypfile": false,
|
|
11
12
|
"scripts": {
|
|
12
13
|
"build:asan": "node-gyp configure build --jobs=max --address_sanitizer",
|
|
13
14
|
"build:tsan": "node-gyp configure build --jobs=max --thread_sanitizer",
|
|
@@ -16,7 +17,6 @@
|
|
|
16
17
|
"compile": "tsc -p .",
|
|
17
18
|
"fix": "gts fix",
|
|
18
19
|
"format": "clang-format --style file -i --glob='bindings/**/*.{h,hh,cpp,cc}'",
|
|
19
|
-
"install": "exit 0",
|
|
20
20
|
"lint": "jsgl --local . && gts check && clang-format --style file -n -Werror --glob='bindings/**/*.{h,hh,cpp,cc}'",
|
|
21
21
|
"prepare": "npm run compile && npm run rebuild",
|
|
22
22
|
"pretest:js-asan": "npm run compile && npm run build:asan",
|
|
@@ -29,41 +29,38 @@
|
|
|
29
29
|
"test:js-tsan": "LD_PRELOAD=`gcc -print-file-name=libtsan.so` mocha out/test/test-*.js",
|
|
30
30
|
"test:js-valgrind": "valgrind --leak-check=full mocha out/test/test-*.js",
|
|
31
31
|
"test:js": "nyc mocha -r source-map-support/register out/test/test-*.js",
|
|
32
|
-
"test": "npm run test:js"
|
|
32
|
+
"test": "npm run test:js",
|
|
33
|
+
"test:docker": "./scripts/docker/run-in-docker.sh"
|
|
33
34
|
},
|
|
34
35
|
"author": {
|
|
35
36
|
"name": "Google Inc."
|
|
36
37
|
},
|
|
37
38
|
"license": "Apache-2.0",
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"node-gyp-build": "
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"source-map": "^0.7.4"
|
|
40
|
+
"node-gyp-build": "^4.8.4",
|
|
41
|
+
"pprof-format": "^2.3.1",
|
|
42
|
+
"source-map": "^0.8.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/mocha": "^10.0.1",
|
|
46
|
-
"@types/node": "
|
|
47
|
-
"@types/
|
|
46
|
+
"@types/node": "26.2.0",
|
|
47
|
+
"@types/semver": "^7.8.0",
|
|
48
|
+
"@types/sinon": "^22.0.0",
|
|
48
49
|
"@types/tmp": "^0.2.3",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
|
50
50
|
"clang-format": "^1.8.0",
|
|
51
51
|
"codecov": "^3.8.3",
|
|
52
52
|
"deep-copy": "^1.4.2",
|
|
53
|
-
"eslint-
|
|
54
|
-
"
|
|
55
|
-
"eslint-plugin-n": "^16.0.1",
|
|
56
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
57
|
-
"gts": "^4.0.1",
|
|
53
|
+
"eslint-plugin-n": "^18.3.0",
|
|
54
|
+
"gts": "^7.0.0",
|
|
58
55
|
"js-green-licenses": "^4.0.0",
|
|
59
|
-
"mocha": "^11.
|
|
60
|
-
"nan": "^2.
|
|
61
|
-
"nyc": "^
|
|
62
|
-
"semver": "^7.
|
|
63
|
-
"sinon": "^
|
|
56
|
+
"mocha": "^11.8.0",
|
|
57
|
+
"nan": "^2.28.0",
|
|
58
|
+
"nyc": "^18.0.0",
|
|
59
|
+
"semver": "^7.8.5",
|
|
60
|
+
"sinon": "^22.1.0",
|
|
64
61
|
"source-map-support": "^0.5.21",
|
|
65
|
-
"tmp": "0.2.
|
|
66
|
-
"typescript": "^
|
|
62
|
+
"tmp": "0.2.7",
|
|
63
|
+
"typescript": "^6.0.3"
|
|
67
64
|
},
|
|
68
65
|
"files": [
|
|
69
66
|
"out/src",
|
|
@@ -88,5 +85,29 @@
|
|
|
88
85
|
"node": ">=16"
|
|
89
86
|
},
|
|
90
87
|
"//": "Temporary fix to make nan@2.22.2 work with Node 24",
|
|
91
|
-
"postinstall": "sed -i '' 's/^.* Holder() const.*//' ./node_modules/nan/nan_callbacks_12_inl.h"
|
|
88
|
+
"postinstall": "sed -i '' 's/^.* Holder() const.*//' ./node_modules/nan/nan_callbacks_12_inl.h",
|
|
89
|
+
"overrides": {
|
|
90
|
+
"nyc": {
|
|
91
|
+
"brace-expansion": "^5.0.6",
|
|
92
|
+
"js-yaml": "^3.14.2"
|
|
93
|
+
},
|
|
94
|
+
"@typescript-eslint/typescript-estree": {
|
|
95
|
+
"brace-expansion": "^5.0.6"
|
|
96
|
+
},
|
|
97
|
+
"istanbul-lib-processinfo": {
|
|
98
|
+
"brace-expansion": "^5.0.6"
|
|
99
|
+
},
|
|
100
|
+
"spawn-wrap": {
|
|
101
|
+
"brace-expansion": "^5.0.6"
|
|
102
|
+
},
|
|
103
|
+
"test-exclude": {
|
|
104
|
+
"brace-expansion": "^5.0.6"
|
|
105
|
+
},
|
|
106
|
+
"codecov": {
|
|
107
|
+
"js-yaml": "^3.14.2"
|
|
108
|
+
},
|
|
109
|
+
"mocha": {
|
|
110
|
+
"minimatch": "^9.0.9"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
92
113
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|