@tapjs/processinfo 1.0.11 → 2.0.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.
Files changed (166) hide show
  1. package/README.md +20 -11
  2. package/dist/cjs/argv-to-node-options.d.ts +2 -0
  3. package/dist/cjs/argv-to-node-options.d.ts.map +1 -0
  4. package/dist/cjs/argv-to-node-options.js +6 -0
  5. package/dist/cjs/argv-to-node-options.js.map +1 -0
  6. package/dist/cjs/child_process.d.ts +205 -0
  7. package/dist/cjs/child_process.d.ts.map +1 -0
  8. package/dist/cjs/child_process.js +109 -0
  9. package/dist/cjs/child_process.js.map +1 -0
  10. package/dist/cjs/cjs.d.ts +2 -0
  11. package/dist/cjs/cjs.d.ts.map +1 -0
  12. package/dist/cjs/cjs.js +5 -0
  13. package/dist/cjs/cjs.js.map +1 -0
  14. package/dist/cjs/get-exclude.d.ts +3 -0
  15. package/dist/cjs/get-exclude.d.ts.map +1 -0
  16. package/dist/cjs/get-exclude.js +23 -0
  17. package/dist/cjs/get-exclude.js.map +1 -0
  18. package/dist/cjs/get-process-info.d.ts +25 -0
  19. package/dist/cjs/get-process-info.d.ts.map +1 -0
  20. package/dist/cjs/get-process-info.js +69 -0
  21. package/dist/cjs/get-process-info.js.map +1 -0
  22. package/dist/cjs/index.d.ts +44 -0
  23. package/dist/cjs/index.d.ts.map +1 -0
  24. package/dist/cjs/index.js +148 -0
  25. package/dist/cjs/index.js.map +1 -0
  26. package/dist/cjs/json-file.d.ts +3 -0
  27. package/dist/cjs/json-file.d.ts.map +1 -0
  28. package/dist/cjs/json-file.js +20 -0
  29. package/dist/cjs/json-file.js.map +1 -0
  30. package/dist/cjs/loader-paths.d.ts +5 -0
  31. package/dist/cjs/loader-paths.d.ts.map +1 -0
  32. package/dist/cjs/loader-paths.js +35 -0
  33. package/dist/cjs/loader-paths.js.map +1 -0
  34. package/dist/cjs/node-options-env.d.ts +6 -0
  35. package/dist/cjs/node-options-env.d.ts.map +1 -0
  36. package/dist/cjs/node-options-env.js +58 -0
  37. package/dist/cjs/node-options-env.js.map +1 -0
  38. package/dist/cjs/node-options-to-argv.d.ts +2 -0
  39. package/dist/cjs/node-options-to-argv.d.ts.map +1 -0
  40. package/dist/cjs/node-options-to-argv.js +58 -0
  41. package/dist/cjs/node-options-to-argv.js.map +1 -0
  42. package/dist/cjs/package.json +3 -0
  43. package/dist/cjs/process-info-node.d.ts +24 -0
  44. package/dist/cjs/process-info-node.d.ts.map +1 -0
  45. package/dist/cjs/process-info-node.js +100 -0
  46. package/dist/cjs/process-info-node.js.map +1 -0
  47. package/dist/cjs/register-cjs.d.ts +2 -0
  48. package/dist/cjs/register-cjs.d.ts.map +1 -0
  49. package/dist/cjs/register-cjs.js +21 -0
  50. package/dist/cjs/register-cjs.js.map +1 -0
  51. package/dist/cjs/register-coverage.d.ts +7 -0
  52. package/dist/cjs/register-coverage.d.ts.map +1 -0
  53. package/dist/cjs/register-coverage.js +94 -0
  54. package/dist/cjs/register-coverage.js.map +1 -0
  55. package/dist/cjs/register-env.d.ts +2 -0
  56. package/dist/cjs/register-env.d.ts.map +1 -0
  57. package/dist/cjs/register-env.js +26 -0
  58. package/dist/cjs/register-env.js.map +1 -0
  59. package/dist/cjs/register-process-end.d.ts +2 -0
  60. package/dist/cjs/register-process-end.d.ts.map +1 -0
  61. package/dist/cjs/register-process-end.js +30 -0
  62. package/dist/cjs/register-process-end.js.map +1 -0
  63. package/dist/cjs/require-resolve-cjs.d.ts.map +1 -0
  64. package/dist/cjs/require-resolve-cjs.js.map +1 -0
  65. package/dist/cjs/require-resolve.d.ts +3 -0
  66. package/dist/cjs/require-resolve.js +9 -0
  67. package/dist/cjs/spawn-opts.d.ts +10 -0
  68. package/dist/cjs/spawn-opts.d.ts.map +1 -0
  69. package/dist/cjs/spawn-opts.js +18 -0
  70. package/dist/cjs/spawn-opts.js.map +1 -0
  71. package/dist/cjs/x.d.ts +2 -0
  72. package/dist/cjs/x.d.ts.map +1 -0
  73. package/dist/cjs/x.js +5 -0
  74. package/dist/cjs/x.js.map +1 -0
  75. package/dist/mjs/argv-to-node-options.d.ts +2 -0
  76. package/dist/mjs/argv-to-node-options.d.ts.map +1 -0
  77. package/dist/mjs/argv-to-node-options.js +2 -0
  78. package/dist/mjs/argv-to-node-options.js.map +1 -0
  79. package/dist/mjs/child_process.d.ts +205 -0
  80. package/dist/mjs/child_process.d.ts.map +1 -0
  81. package/dist/mjs/child_process.js +99 -0
  82. package/dist/mjs/child_process.js.map +1 -0
  83. package/dist/mjs/esm.d.mts +11 -0
  84. package/dist/mjs/esm.d.mts.map +1 -0
  85. package/dist/mjs/esm.mjs +45 -0
  86. package/dist/mjs/esm.mjs.map +1 -0
  87. package/dist/mjs/get-exclude.d.ts +3 -0
  88. package/dist/mjs/get-exclude.d.ts.map +1 -0
  89. package/dist/mjs/get-exclude.js +19 -0
  90. package/dist/mjs/get-exclude.js.map +1 -0
  91. package/dist/mjs/get-process-info.d.ts +25 -0
  92. package/dist/mjs/get-process-info.d.ts.map +1 -0
  93. package/dist/mjs/get-process-info.js +64 -0
  94. package/dist/mjs/get-process-info.js.map +1 -0
  95. package/dist/mjs/index.d.ts +44 -0
  96. package/dist/mjs/index.d.ts.map +1 -0
  97. package/dist/mjs/index.js +130 -0
  98. package/dist/mjs/index.js.map +1 -0
  99. package/dist/mjs/json-file.d.ts +3 -0
  100. package/dist/mjs/json-file.d.ts.map +1 -0
  101. package/dist/mjs/json-file.js +15 -0
  102. package/dist/mjs/json-file.js.map +1 -0
  103. package/dist/mjs/loader-paths.d.ts +5 -0
  104. package/dist/mjs/loader-paths.d.ts.map +1 -0
  105. package/dist/mjs/loader-paths.js +30 -0
  106. package/dist/mjs/loader-paths.js.map +1 -0
  107. package/dist/mjs/node-options-env.d.ts +6 -0
  108. package/dist/mjs/node-options-env.d.ts.map +1 -0
  109. package/dist/mjs/node-options-env.js +54 -0
  110. package/dist/mjs/node-options-env.js.map +1 -0
  111. package/dist/mjs/node-options-to-argv.d.ts +2 -0
  112. package/dist/mjs/node-options-to-argv.d.ts.map +1 -0
  113. package/dist/mjs/node-options-to-argv.js +54 -0
  114. package/dist/mjs/node-options-to-argv.js.map +1 -0
  115. package/dist/mjs/package.json +3 -0
  116. package/dist/mjs/process-info-node.d.ts +24 -0
  117. package/dist/mjs/process-info-node.d.ts.map +1 -0
  118. package/dist/mjs/process-info-node.js +96 -0
  119. package/dist/mjs/process-info-node.js.map +1 -0
  120. package/dist/mjs/register-cjs.d.ts +2 -0
  121. package/dist/mjs/register-cjs.d.ts.map +1 -0
  122. package/dist/mjs/register-cjs.js +17 -0
  123. package/dist/mjs/register-cjs.js.map +1 -0
  124. package/dist/mjs/register-coverage.d.ts +7 -0
  125. package/dist/mjs/register-coverage.d.ts.map +1 -0
  126. package/dist/mjs/register-coverage.js +89 -0
  127. package/dist/mjs/register-coverage.js.map +1 -0
  128. package/dist/mjs/register-env.d.ts +2 -0
  129. package/dist/mjs/register-env.d.ts.map +1 -0
  130. package/dist/mjs/register-env.js +19 -0
  131. package/dist/mjs/register-env.js.map +1 -0
  132. package/dist/mjs/register-process-end.d.ts +2 -0
  133. package/dist/mjs/register-process-end.d.ts.map +1 -0
  134. package/dist/mjs/register-process-end.js +26 -0
  135. package/dist/mjs/register-process-end.js.map +1 -0
  136. package/dist/mjs/require-resolve.d.ts +3 -0
  137. package/dist/mjs/require-resolve.d.ts.map +1 -0
  138. package/dist/mjs/require-resolve.js +9 -0
  139. package/dist/mjs/require-resolve.js.map +1 -0
  140. package/dist/mjs/spawn-opts.d.ts +10 -0
  141. package/dist/mjs/spawn-opts.d.ts.map +1 -0
  142. package/dist/mjs/spawn-opts.js +14 -0
  143. package/dist/mjs/spawn-opts.js.map +1 -0
  144. package/dist/mjs/x.d.ts +2 -0
  145. package/dist/mjs/x.d.ts.map +1 -0
  146. package/dist/mjs/x.js +2 -0
  147. package/dist/mjs/x.js.map +1 -0
  148. package/package.json +49 -19
  149. package/index.d.ts +0 -196
  150. package/lib/argv-to-node-options.cjs +0 -2
  151. package/lib/child_process.cjs +0 -81
  152. package/lib/cjs.cjs +0 -16
  153. package/lib/esm.mjs +0 -74
  154. package/lib/get-exclude.cjs +0 -21
  155. package/lib/get-process-info.cjs +0 -45
  156. package/lib/index.cjs +0 -163
  157. package/lib/index.d.cts +0 -196
  158. package/lib/index.d.ts +0 -196
  159. package/lib/json-file.cjs +0 -19
  160. package/lib/node-options-env.cjs +0 -100
  161. package/lib/node-options-to-argv.cjs +0 -52
  162. package/lib/process-info-node.cjs +0 -84
  163. package/lib/register-coverage.cjs +0 -74
  164. package/lib/register-env.cjs +0 -21
  165. package/lib/register-process-end.cjs +0 -29
  166. package/lib/spawn-opts.cjs +0 -16
@@ -0,0 +1,205 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ /// <reference types="node" />
5
+ import { ChildProcess, ChildProcessByStdio, ChildProcessWithoutNullStreams, ExecException, ExecFileException, ExecFileOptions, ExecFileOptionsWithBufferEncoding, ExecFileOptionsWithOtherEncoding, ExecFileOptionsWithStringEncoding, ExecFileSyncOptions, ExecFileSyncOptionsWithBufferEncoding, ExecFileSyncOptionsWithStringEncoding, ExecOptions, ExecSyncOptions, ExecSyncOptionsWithBufferEncoding, ExecSyncOptionsWithStringEncoding, ForkOptions, PromiseWithChild, SpawnOptions, SpawnOptionsWithoutStdio, SpawnOptionsWithStdioTuple, SpawnSyncOptions, SpawnSyncOptionsWithBufferEncoding, SpawnSyncOptionsWithStringEncoding, SpawnSyncReturns, StdioNull, StdioPipe } from 'child_process';
6
+ import type { ObjectEncodingOptions } from 'fs';
7
+ import type { Readable, Writable } from 'stream';
8
+ import { WithExternalID } from './spawn-opts.js';
9
+ export declare function spawn(command: string, options?: WithExternalID<SpawnOptionsWithoutStdio>): ChildProcessWithoutNullStreams;
10
+ export declare function spawn(command: string, options: WithExternalID<SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>>): ChildProcessByStdio<Writable, Readable, Readable>;
11
+ export declare function spawn(command: string, options: WithExternalID<SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>>): ChildProcessByStdio<Writable, Readable, null>;
12
+ export declare function spawn(command: string, options: WithExternalID<SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>>): ChildProcessByStdio<Writable, null, Readable>;
13
+ export declare function spawn(command: string, options: WithExternalID<SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>>): ChildProcessByStdio<null, Readable, Readable>;
14
+ export declare function spawn(command: string, options: WithExternalID<SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>>): ChildProcessByStdio<Writable, null, null>;
15
+ export declare function spawn(command: string, options: WithExternalID<SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>>): ChildProcessByStdio<null, Readable, null>;
16
+ export declare function spawn(command: string, options: WithExternalID<SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>>): ChildProcessByStdio<null, null, Readable>;
17
+ export declare function spawn(command: string, options: WithExternalID<SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>>): ChildProcessByStdio<null, null, null>;
18
+ export declare function spawn(command: string, options: WithExternalID<SpawnOptions>): ChildProcess;
19
+ export declare function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
20
+ export declare function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>): ChildProcessByStdio<Writable, Readable, Readable>;
21
+ export declare function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>): ChildProcessByStdio<Writable, Readable, null>;
22
+ export declare function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>): ChildProcessByStdio<Writable, null, Readable>;
23
+ export declare function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>): ChildProcessByStdio<null, Readable, Readable>;
24
+ export declare function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>): ChildProcessByStdio<Writable, null, null>;
25
+ export declare function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>): ChildProcessByStdio<null, Readable, null>;
26
+ export declare function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>): ChildProcessByStdio<null, null, Readable>;
27
+ export declare function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>): ChildProcessByStdio<null, null, null>;
28
+ export declare function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptions): ChildProcess;
29
+ export declare function spawnSync(command: string): SpawnSyncReturns<Buffer>;
30
+ export declare function spawnSync(command: string, options: WithExternalID<SpawnSyncOptionsWithStringEncoding>): SpawnSyncReturns<string>;
31
+ export declare function spawnSync(command: string, options: WithExternalID<SpawnSyncOptionsWithBufferEncoding>): SpawnSyncReturns<Buffer>;
32
+ export declare function spawnSync(command: string, options?: WithExternalID<SpawnSyncOptions>): SpawnSyncReturns<string | Buffer>;
33
+ export declare function spawnSync(command: string, args: ReadonlyArray<string>): SpawnSyncReturns<Buffer>;
34
+ export declare function spawnSync(command: string, args: ReadonlyArray<string>, options: WithExternalID<SpawnSyncOptionsWithStringEncoding>): SpawnSyncReturns<string>;
35
+ export declare function spawnSync(command: string, args: ReadonlyArray<string>, options: WithExternalID<SpawnSyncOptionsWithBufferEncoding>): SpawnSyncReturns<Buffer>;
36
+ export declare function spawnSync(command: string, args?: ReadonlyArray<string>, options?: WithExternalID<SpawnSyncOptions>): SpawnSyncReturns<string | Buffer>;
37
+ export type ExecArgs = [
38
+ command: string,
39
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void
40
+ ] | [
41
+ command: string,
42
+ options: WithExternalID<{
43
+ encoding: 'buffer' | null;
44
+ } & ExecOptions>,
45
+ callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void
46
+ ] | [
47
+ command: string,
48
+ options: WithExternalID<{
49
+ encoding: BufferEncoding;
50
+ } & ExecOptions>,
51
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void
52
+ ] | [
53
+ command: string,
54
+ options: WithExternalID<{
55
+ encoding: BufferEncoding;
56
+ } & ExecOptions>,
57
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void
58
+ ] | [
59
+ command: string,
60
+ options: WithExternalID<ExecOptions>,
61
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void
62
+ ] | [
63
+ command: string,
64
+ options: WithExternalID<ObjectEncodingOptions & ExecOptions> | undefined | null,
65
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void
66
+ ];
67
+ export declare function exec(...args: ExecArgs): ChildProcess;
68
+ export declare namespace exec {
69
+ function __promisify__(command: string): PromiseWithChild<{
70
+ stdout: string;
71
+ stderr: string;
72
+ }>;
73
+ function __promisify__(command: string, options: WithExternalID<{
74
+ encoding: 'buffer' | null;
75
+ } & ExecOptions>): PromiseWithChild<{
76
+ stdout: Buffer;
77
+ stderr: Buffer;
78
+ }>;
79
+ function __promisify__(command: string, options: WithExternalID<{
80
+ encoding: BufferEncoding;
81
+ } & ExecOptions>): PromiseWithChild<{
82
+ stdout: string;
83
+ stderr: string;
84
+ }>;
85
+ function __promisify__(command: string, options: WithExternalID<ExecOptions>): PromiseWithChild<{
86
+ stdout: string;
87
+ stderr: string;
88
+ }>;
89
+ function __promisify__(command: string, options?: WithExternalID<ObjectEncodingOptions & ExecOptions> | null): PromiseWithChild<{
90
+ stdout: string | Buffer;
91
+ stderr: string | Buffer;
92
+ }>;
93
+ }
94
+ export declare function execSync(command: string): Buffer;
95
+ export declare function execSync(command: string, options: WithExternalID<ExecSyncOptionsWithStringEncoding>): string;
96
+ export declare function execSync(command: string, options: WithExternalID<ExecSyncOptionsWithBufferEncoding>): Buffer;
97
+ export declare function execSync(command: string, options?: WithExternalID<ExecSyncOptions>): string | Buffer;
98
+ export type ExecFileArgs = [] | [
99
+ options: WithExternalID<ObjectEncodingOptions & ExecFileOptions> | undefined | null
100
+ ] | [args?: ReadonlyArray<string> | null] | [
101
+ args: ReadonlyArray<string> | undefined | null,
102
+ options: WithExternalID<ObjectEncodingOptions & ExecFileOptions> | undefined | null
103
+ ] | [
104
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
105
+ ] | [
106
+ args: ReadonlyArray<string> | undefined | null,
107
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
108
+ ] | [
109
+ options: WithExternalID<ExecFileOptionsWithBufferEncoding>,
110
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void
111
+ ] | [
112
+ args: ReadonlyArray<string> | undefined | null,
113
+ options: WithExternalID<ExecFileOptionsWithBufferEncoding>,
114
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void
115
+ ] | [
116
+ options: WithExternalID<ExecFileOptionsWithStringEncoding>,
117
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
118
+ ] | [
119
+ args: ReadonlyArray<string> | undefined | null,
120
+ options: WithExternalID<ExecFileOptionsWithStringEncoding>,
121
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
122
+ ] | [
123
+ options: WithExternalID<ExecFileOptionsWithOtherEncoding>,
124
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void
125
+ ] | [
126
+ args: ReadonlyArray<string> | undefined | null,
127
+ options: WithExternalID<ExecFileOptionsWithOtherEncoding>,
128
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void
129
+ ] | [
130
+ options: WithExternalID<ExecFileOptions>,
131
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
132
+ ] | [
133
+ args: ReadonlyArray<string> | undefined | null,
134
+ options: WithExternalID<ExecFileOptions>,
135
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
136
+ ] | [
137
+ options: WithExternalID<ObjectEncodingOptions & ExecFileOptions> | undefined | null,
138
+ callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null
139
+ ] | [
140
+ args: ReadonlyArray<string> | undefined | null,
141
+ options: WithExternalID<ObjectEncodingOptions & ExecFileOptions> | undefined | null,
142
+ callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null
143
+ ];
144
+ export declare function execFile(file: string, ...execFileArgs: ExecFileArgs): ChildProcess;
145
+ export declare namespace execFile {
146
+ function __promisify__(file: string): PromiseWithChild<{
147
+ stdout: string;
148
+ stderr: string;
149
+ }>;
150
+ function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null): PromiseWithChild<{
151
+ stdout: string;
152
+ stderr: string;
153
+ }>;
154
+ function __promisify__(file: string, options: WithExternalID<ExecFileOptionsWithBufferEncoding>): PromiseWithChild<{
155
+ stdout: Buffer;
156
+ stderr: Buffer;
157
+ }>;
158
+ function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: WithExternalID<ExecFileOptionsWithBufferEncoding>): PromiseWithChild<{
159
+ stdout: Buffer;
160
+ stderr: Buffer;
161
+ }>;
162
+ function __promisify__(file: string, options: WithExternalID<ExecFileOptionsWithStringEncoding>): PromiseWithChild<{
163
+ stdout: string;
164
+ stderr: string;
165
+ }>;
166
+ function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: WithExternalID<ExecFileOptionsWithStringEncoding>): PromiseWithChild<{
167
+ stdout: string;
168
+ stderr: string;
169
+ }>;
170
+ function __promisify__(file: string, options: WithExternalID<ExecFileOptionsWithOtherEncoding>): PromiseWithChild<{
171
+ stdout: string | Buffer;
172
+ stderr: string | Buffer;
173
+ }>;
174
+ function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: WithExternalID<ExecFileOptionsWithOtherEncoding>): PromiseWithChild<{
175
+ stdout: string | Buffer;
176
+ stderr: string | Buffer;
177
+ }>;
178
+ function __promisify__(file: string, options: WithExternalID<ExecFileOptions>): PromiseWithChild<{
179
+ stdout: string;
180
+ stderr: string;
181
+ }>;
182
+ function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: WithExternalID<ExecFileOptions>): PromiseWithChild<{
183
+ stdout: string;
184
+ stderr: string;
185
+ }>;
186
+ function __promisify__(file: string, options: WithExternalID<ObjectEncodingOptions & ExecFileOptions> | undefined | null): PromiseWithChild<{
187
+ stdout: string | Buffer;
188
+ stderr: string | Buffer;
189
+ }>;
190
+ function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: WithExternalID<ObjectEncodingOptions & ExecFileOptions> | undefined | null): PromiseWithChild<{
191
+ stdout: string | Buffer;
192
+ stderr: string | Buffer;
193
+ }>;
194
+ }
195
+ export declare function execFileSync(file: string): Buffer;
196
+ export declare function execFileSync(file: string, options: WithExternalID<ExecFileSyncOptionsWithStringEncoding>): string;
197
+ export declare function execFileSync(file: string, options: WithExternalID<ExecFileSyncOptionsWithBufferEncoding>): Buffer;
198
+ export declare function execFileSync(file: string, options?: WithExternalID<ExecFileSyncOptions>): string | Buffer;
199
+ export declare function execFileSync(file: string, args: ReadonlyArray<string>): Buffer;
200
+ export declare function execFileSync(file: string, args: ReadonlyArray<string>, options: WithExternalID<ExecFileSyncOptionsWithStringEncoding>): string;
201
+ export declare function execFileSync(file: string, args: ReadonlyArray<string>, options: WithExternalID<ExecFileSyncOptionsWithBufferEncoding>): Buffer;
202
+ export declare function execFileSync(file: string, args?: ReadonlyArray<string>, options?: WithExternalID<ExecFileSyncOptions>): string | Buffer;
203
+ export declare function fork(modulePath: string, options?: ForkOptions): ChildProcess;
204
+ export declare function fork(modulePath: string, args?: ReadonlyArray<string>, options?: WithExternalID<ForkOptions>): ChildProcess;
205
+ //# sourceMappingURL=child_process.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child_process.d.ts","sourceRoot":"","sources":["../../lib/child_process.ts"],"names":[],"mappings":";;;;AAEA,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,8BAA8B,EAE9B,aAAa,EAEb,iBAAiB,EACjB,eAAe,EACf,iCAAiC,EACjC,gCAAgC,EAChC,iCAAiC,EAEjC,mBAAmB,EACnB,qCAAqC,EACrC,qCAAqC,EACrC,WAAW,EAEX,eAAe,EACf,iCAAiC,EACjC,iCAAiC,EAEjC,WAAW,EACX,gBAAgB,EAEhB,YAAY,EACZ,wBAAwB,EACxB,0BAA0B,EAE1B,gBAAgB,EAChB,kCAAkC,EAClC,kCAAkC,EAClC,gBAAgB,EAChB,SAAS,EACT,SAAS,EACV,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,IAAI,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEhD,OAAO,EAAa,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAqB3D,wBAAgB,KAAK,CACnB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,cAAc,CAAC,wBAAwB,CAAC,GACjD,8BAA8B,CAAA;AACjC,wBAAgB,KAAK,CACnB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,cAAc,CACrB,0BAA0B,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAC5D,GACA,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;AACpD,wBAAgB,KAAK,CACnB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,cAAc,CACrB,0BAA0B,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAC5D,GACA,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;AAChD,wBAAgB,KAAK,CACnB,OA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AM,CAAC,GAC1B,MAAM,CAAA;AACT,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,EAC3B,OAAO,EAAE,cAAc,CAAC,qCAAqC,CAAC,GAC7D,MAAM,CAAA;AACT,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,EAC3B,OAAO,EAAE,cAAc,CAAC,qCAAqC,CAAC,GAC7D,MAAM,CAAA;AACT,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,OAAO,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC,GAC5C,MAAM,GAAG,MAAM,CAAA;AAgClB,wBAAgB,IAAI,CAClB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,WAAW,GACpB,YAAY,CAAA;AACf,wBAAgB,IAAI,CAClB,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,OAAO,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,GACpC,YAAY,CAAA"}
@@ -0,0 +1,99 @@
1
+ // This wraps all of the various spawn methods such that externalID can be
2
+ // set in the options, and ensuring that the proper envs get set.
3
+ import { exec as cpExec, execFile as cpExecFile, execFileSync as cpExecFileSync, execSync as cpExecSync, fork as cpFork, spawn as cpSpawn, spawnSync as cpSpawnSync, } from 'child_process';
4
+ import { getExclude } from './get-exclude.js';
5
+ import { spawnOpts } from './spawn-opts.js';
6
+ const promisify = Symbol.for('nodejs.util.promisify.custom');
7
+ const customPromisify = (e) =>
8
+ // the node types list it as __promisify__ but it's actually the symbol
9
+ /* c8 ignore start */
10
+ e[promisify] || e.__promisify__;
11
+ /* c8 ignore stop */
12
+ const k = '_TAPJS_PROCESSINFO_EXCLUDE_';
13
+ // coercion function when we know it's an array or something else
14
+ const isNotArray = (o) => !!o && typeof o === 'object' && !Array.isArray(o);
15
+ export function spawn(cmd, args, options) {
16
+ if (isNotArray(args)) {
17
+ options = args;
18
+ args = [];
19
+ }
20
+ return cpSpawn(cmd, args || [], spawnOpts(options || {}, getExclude(k)));
21
+ }
22
+ export function spawnSync(cmd, args, options) {
23
+ if (isNotArray(args)) {
24
+ options = args;
25
+ args = [];
26
+ }
27
+ return cpSpawnSync(cmd, args || [], spawnOpts(options || {}, getExclude(k)));
28
+ }
29
+ export function exec(...args) {
30
+ const [cmd, options, callback] = args;
31
+ if (typeof options === 'function') {
32
+ return cpExec(cmd, spawnOpts({}, getExclude(k)), options);
33
+ }
34
+ else if (!options) {
35
+ return cpExec(cmd, spawnOpts({}, getExclude(k)), callback);
36
+ }
37
+ return cpExec(cmd, spawnOpts(options, getExclude(k)), callback);
38
+ }
39
+ (function (exec) {
40
+ function __promisify__(command, options) {
41
+ return customPromisify(cpExec)(command, spawnOpts(options || {}, getExclude(k)));
42
+ }
43
+ exec.__promisify__ = __promisify__;
44
+ Object.assign(exec, { [promisify]: __promisify__ });
45
+ /* c8 ignore start */
46
+ })(exec || (exec = {}));
47
+ export function execSync(cmd, options) {
48
+ return cpExecSync(cmd, spawnOpts(options || {}, getExclude(k)));
49
+ }
50
+ export function execFile(file, ...execFileArgs) {
51
+ let args = [];
52
+ let options = {};
53
+ let callback = undefined;
54
+ for (const arg of execFileArgs) {
55
+ if (Array.isArray(arg)) {
56
+ args = arg;
57
+ }
58
+ else if (arg &&
59
+ typeof arg === 'object' &&
60
+ isNotArray(arg)) {
61
+ options = arg;
62
+ }
63
+ else if (typeof arg === 'function') {
64
+ callback = arg;
65
+ }
66
+ }
67
+ return cpExecFile(file, args, spawnOpts(options, getExclude(k)), callback);
68
+ }
69
+ (function (execFile) {
70
+ function __promisify__(file, args, options) {
71
+ if (!!args &&
72
+ typeof args === 'object' &&
73
+ isNotArray(args)) {
74
+ options = args;
75
+ args = [];
76
+ }
77
+ return customPromisify(cpExecFile)(file, spawnOpts(options || {}, getExclude(k)));
78
+ }
79
+ execFile.__promisify__ = __promisify__;
80
+ Object.assign(execFile, { [promisify]: __promisify__ });
81
+ /* c8 ignore start */
82
+ })(execFile || (execFile = {}));
83
+ export function execFileSync(file, args, options) {
84
+ if (args &&
85
+ typeof args === 'object' &&
86
+ isNotArray(args)) {
87
+ options = args;
88
+ args = [];
89
+ }
90
+ return cpExecFileSync(file, args || [], spawnOpts(options || {}, getExclude(k)));
91
+ }
92
+ export function fork(modulePath, args, options) {
93
+ if (isNotArray(args)) {
94
+ options = args;
95
+ args = [];
96
+ }
97
+ return cpFork(modulePath, args, spawnOpts(options || {}, getExclude(k)));
98
+ }
99
+ //# sourceMappingURL=child_process.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child_process.js","sourceRoot":"","sources":["../../lib/child_process.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,iEAAiE;AACjE,OAAO,EAIL,IAAI,IAAI,MAAM,EAEd,QAAQ,IAAI,UAAU,EAMtB,YAAY,IAAI,cAAc,EAK9B,QAAQ,IAAI,UAAU,EAItB,IAAI,IAAI,MAAM,EAGd,KAAK,IAAI,OAAO,EAIhB,SAAS,IAAI,WAAW,GAOzB,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAkB,MAAM,iBAAiB,CAAA;AAE3D,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;AAO5D,MAAM,eAAe,GAAG,CAAkB,CAAI,EAAE,EAAE;AAChD,uEAAuE;AACvE,qBAAqB;AACpB,CAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,aAAa,CAAA;AAC5C,oBAAoB;AAEpB,MAAM,CAAC,GAAG,6BAA6B,CAAA;AAEvC,iEAAiE;AACjE,MAAM,UAAU,GAAG,CAAiC,CAAM,EAAU,EAAE,CACpE,CAA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AAC,CAAA;AAC1E,CAAC","sourcesContent":["// This wraps all of the various spawn methods such that externalID can be\n// set in the options, and ensuring that the proper envs get set.\nimport {\n ChildProcess,\n ChildProcessByStdio,\n ChildProcessWithoutNullStreams,\n exec as cpExec,\n ExecException,\n execFile as cpExecFile,\n ExecFileException,\n ExecFileOptions,\n ExecFileOptionsWithBufferEncoding,\n ExecFileOptionsWithOtherEncoding,\n ExecFileOptionsWithStringEncoding,\n execFileSync as cpExecFileSync,\n ExecFileSyncOptions,\n ExecFileSyncOptionsWithBufferEncoding,\n ExecFileSyncOptionsWithStringEncoding,\n ExecOptions,\n execSync as cpExecSync,\n ExecSyncOptions,\n ExecSyncOptionsWithBufferEncoding,\n ExecSyncOptionsWithStringEncoding,\n fork as cpFork,\n ForkOptions,\n PromiseWithChild,\n spawn as cpSpawn,\n SpawnOptions,\n SpawnOptionsWithoutStdio,\n SpawnOptionsWithStdioTuple,\n spawnSync as cpSpawnSync,\n SpawnSyncOptions,\n SpawnSyncOptionsWithBufferEncoding,\n SpawnSyncOptionsWithStringEncoding,\n SpawnSyncReturns,\n StdioNull,\n StdioPipe,\n} from 'child_process'\nimport type { ObjectEncodingOptions } from 'fs'\nimport type { Readable, Writable } from 'stream'\nimport { getExclude } from './get-exclude.js'\nimport { spawnOpts, WithExternalID } from './spawn-opts.js'\n\nconst promisify = Symbol.for('nodejs.util.promisify.custom')\n\n// pull the old __promisify__ out of node's declared namespaces\ntype CP<T extends { __promisify__: any }> = T & {\n [promisify]: T['__promisify__']\n}\ntype OldCP = { __promisify__: (...a: any) => any }\nconst customPromisify = <T extends OldCP>(e: T) =>\n // the node types list it as __promisify__ but it's actually the symbol\n /* c8 ignore start */\n (e as CP<T>)[promisify] || e.__promisify__\n/* c8 ignore stop */\n\nconst k = '_TAPJS_PROCESSINFO_EXCLUDE_'\n\n// coercion function when we know it's an array or something else\nconst isNotArray = <T extends { [k: string]: any }>(o: any): o is T =>\n !!o && typeof o === 'object' && !Array.isArray(o)\n\nexport function spawn(\n command: string,\n options?: WithExternalID<SpawnOptionsWithoutStdio>\n): ChildProcessWithoutNullStreams\nexport function spawn(\n command: string,\n options: WithExternalID<\n SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>\n >\n): ChildProcessByStdio<Writable, Readable, Readable>\nexport function spawn(\n command: string,\n options: WithExternalID<\n SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>\n >\n): ChildProcessByStdio<Writable, Readable, null>\nexport function spawn(\n command: string,\n options: WithExternalID<\n SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>\n >\n): ChildProcessByStdio<Writable, null, Readable>\nexport function spawn(\n command: string,\n options: WithExternalID<\n SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>\n >\n): ChildProcessByStdio<null, Readable, Readable>\nexport function spawn(\n command: string,\n options: WithExternalID<\n SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>\n >\n): ChildProcessByStdio<Writable, null, null>\nexport function spawn(\n command: string,\n options: WithExternalID<\n SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>\n >\n): ChildProcessByStdio<null, Readable, null>\nexport function spawn(\n command: string,\n options: WithExternalID<\n SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>\n >\n): ChildProcessByStdio<null, null, Readable>\nexport function spawn(\n command: string,\n options: WithExternalID<\n SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>\n >\n): ChildProcessByStdio<null, null, null>\nexport function spawn(\n command: string,\n options: WithExternalID<SpawnOptions>\n): ChildProcess\nexport function spawn(\n command: string,\n args?: ReadonlyArray<string>,\n options?: SpawnOptionsWithoutStdio\n): ChildProcessWithoutNullStreams\nexport function spawn(\n command: string,\n args: ReadonlyArray<string>,\n options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>\n): ChildProcessByStdio<Writable, Readable, Readable>\nexport function spawn(\n command: string,\n args: ReadonlyArray<string>,\n options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>\n): ChildProcessByStdio<Writable, Readable, null>\nexport function spawn(\n command: string,\n args: ReadonlyArray<string>,\n options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>\n): ChildProcessByStdio<Writable, null, Readable>\nexport function spawn(\n command: string,\n args: ReadonlyArray<string>,\n options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>\n): ChildProcessByStdio<null, Readable, Readable>\nexport function spawn(\n command: string,\n args: ReadonlyArray<string>,\n options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>\n): ChildProcessByStdio<Writable, null, null>\nexport function spawn(\n command: string,\n args: ReadonlyArray<string>,\n options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>\n): ChildProcessByStdio<null, Readable, null>\nexport function spawn(\n command: string,\n args: ReadonlyArray<string>,\n options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>\n): ChildProcessByStdio<null, null, Readable>\nexport function spawn(\n command: string,\n args: ReadonlyArray<string>,\n options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>\n): ChildProcessByStdio<null, null, null>\nexport function spawn(\n command: string,\n args: ReadonlyArray<string>,\n options: SpawnOptions\n): ChildProcess\n\nexport function spawn(\n cmd: string,\n args?:\n | ReadonlyArray<string>\n | WithExternalID<SpawnOptions>\n | WithExternalID<SpawnOptionsWithoutStdio>\n | WithExternalID<\n SpawnOptionsWithStdioTuple<\n StdioNull | StdioPipe,\n StdioNull | StdioPipe,\n StdioNull | StdioPipe\n >\n >,\n options?:\n | WithExternalID<SpawnOptions>\n | WithExternalID<SpawnOptionsWithoutStdio>\n | WithExternalID<\n SpawnOptionsWithStdioTuple<\n StdioNull | StdioPipe,\n StdioNull | StdioPipe,\n StdioNull | StdioPipe\n >\n >\n): ChildProcess | ChildProcessWithoutNullStreams {\n if (isNotArray<SpawnOptions>(args)) {\n options = args\n args = []\n }\n return cpSpawn(cmd, args || [], spawnOpts(options || {}, getExclude(k)))\n}\n\nexport function spawnSync(command: string): SpawnSyncReturns<Buffer>\nexport function spawnSync(\n command: string,\n options: WithExternalID<SpawnSyncOptionsWithStringEncoding>\n): SpawnSyncReturns<string>\nexport function spawnSync(\n command: string,\n options: WithExternalID<SpawnSyncOptionsWithBufferEncoding>\n): SpawnSyncReturns<Buffer>\nexport function spawnSync(\n command: string,\n options?: WithExternalID<SpawnSyncOptions>\n): SpawnSyncReturns<string | Buffer>\nexport function spawnSync(\n command: string,\n args: ReadonlyArray<string>\n): SpawnSyncReturns<Buffer>\nexport function spawnSync(\n command: string,\n args: ReadonlyArray<string>,\n options: WithExternalID<SpawnSyncOptionsWithStringEncoding>\n): SpawnSyncReturns<string>\nexport function spawnSync(\n command: string,\n args: ReadonlyArray<string>,\n options: WithExternalID<SpawnSyncOptionsWithBufferEncoding>\n): SpawnSyncReturns<Buffer>\nexport function spawnSync(\n command: string,\n args?: ReadonlyArray<string>,\n options?: WithExternalID<SpawnSyncOptions>\n): SpawnSyncReturns<string | Buffer>\n\nexport function spawnSync(\n cmd: string,\n args?:\n | WithExternalID<SpawnSyncOptionsWithStringEncoding>\n | WithExternalID<SpawnSyncOptionsWithBufferEncoding>\n | WithExternalID<SpawnSyncOptions>\n | ReadonlyArray<string>,\n options?:\n | WithExternalID<SpawnSyncOptionsWithStringEncoding>\n | WithExternalID<SpawnSyncOptionsWithBufferEncoding>\n | WithExternalID<SpawnSyncOptions>\n) {\n if (isNotArray<SpawnSyncOptions>(args)) {\n options = args\n args = []\n }\n return cpSpawnSync(\n cmd,\n args || [],\n spawnOpts(options || {}, getExclude(k))\n )\n}\n\nexport type ExecArgs =\n | [\n command: string,\n callback?: (\n error: ExecException | null,\n stdout: string,\n stderr: string\n ) => void\n ]\n | [\n command: string,\n options: WithExternalID<\n {\n encoding: 'buffer' | null\n } & ExecOptions\n >,\n callback?: (\n error: ExecException | null,\n stdout: Buffer,\n stderr: Buffer\n ) => void\n ]\n | [\n command: string,\n options: WithExternalID<\n {\n encoding: BufferEncoding\n } & ExecOptions\n >,\n callback?: (\n error: ExecException | null,\n stdout: string,\n stderr: string\n ) => void\n ]\n | [\n command: string,\n options: WithExternalID<\n {\n encoding: BufferEncoding\n } & ExecOptions\n >,\n callback?: (\n error: ExecException | null,\n stdout: string | Buffer,\n stderr: string | Buffer\n ) => void\n ]\n | [\n command: string,\n options: WithExternalID<ExecOptions>,\n callback?: (\n error: ExecException | null,\n stdout: string,\n stderr: string\n ) => void\n ]\n | [\n command: string,\n options:\n | WithExternalID<ObjectEncodingOptions & ExecOptions>\n | undefined\n | null,\n callback?: (\n error: ExecException | null,\n stdout: string | Buffer,\n stderr: string | Buffer\n ) => void\n ]\nexport function exec(...args: ExecArgs): ChildProcess {\n const [cmd, options, callback] = args\n if (typeof options === 'function') {\n return cpExec(cmd, spawnOpts<ExecOptions>({}, getExclude(k)), options)\n } else if (!options) {\n return cpExec(\n cmd,\n spawnOpts<ExecOptions>({}, getExclude(k)),\n callback as (\n error: ExecException | null,\n stdout: string | Buffer,\n stderr: string | Buffer\n ) => void\n )\n }\n\n return cpExec(\n cmd,\n spawnOpts(options, getExclude(k)),\n callback as (\n error: ExecException | null,\n stdout: string | Buffer,\n stderr: string | Buffer\n ) => void\n )\n}\n\nexport namespace exec {\n export function __promisify__(command: string): PromiseWithChild<{\n stdout: string\n stderr: string\n }>\n export function __promisify__(\n command: string,\n options: WithExternalID<\n {\n encoding: 'buffer' | null\n } & ExecOptions\n >\n ): PromiseWithChild<{\n stdout: Buffer\n stderr: Buffer\n }>\n export function __promisify__(\n command: string,\n options: WithExternalID<\n {\n encoding: BufferEncoding\n } & ExecOptions\n >\n ): PromiseWithChild<{\n stdout: string\n stderr: string\n }>\n export function __promisify__(\n command: string,\n options: WithExternalID<ExecOptions>\n ): PromiseWithChild<{\n stdout: string\n stderr: string\n }>\n export function __promisify__(\n command: string,\n options?: WithExternalID<ObjectEncodingOptions & ExecOptions> | null\n ): PromiseWithChild<{\n stdout: string | Buffer\n stderr: string | Buffer\n }>\n export function __promisify__(\n command: string,\n options?:\n | WithExternalID<\n {\n encoding: 'buffer' | null\n } & ExecOptions\n >\n | WithExternalID<\n {\n encoding: BufferEncoding\n } & ExecOptions\n >\n | WithExternalID<ExecOptions>\n | WithExternalID<ObjectEncodingOptions & ExecOptions>\n | null\n ): PromiseWithChild<{\n stdout: string | Buffer\n stderr: string | Buffer\n }> {\n return customPromisify(cpExec)(\n command,\n spawnOpts(options || {}, getExclude(k))\n )\n }\n\n Object.assign(exec, { [promisify]: __promisify__ })\n /* c8 ignore start */\n}\n/* c8 ignore stop */\n\nexport function execSync(command: string): Buffer\nexport function execSync(\n command: string,\n options: WithExternalID<ExecSyncOptionsWithStringEncoding>\n): string\nexport function execSync(\n command: string,\n options: WithExternalID<ExecSyncOptionsWithBufferEncoding>\n): Buffer\nexport function execSync(\n command: string,\n options?: WithExternalID<ExecSyncOptions>\n): string | Buffer\nexport function execSync(\n cmd: string,\n options?:\n | WithExternalID<ExecSyncOptions>\n | WithExternalID<ExecSyncOptionsWithBufferEncoding>\n | WithExternalID<ExecSyncOptionsWithStringEncoding>\n | WithExternalID<ExecSyncOptionsWithBufferEncoding>\n): string | Buffer {\n return cpExecSync(\n cmd,\n spawnOpts<ExecSyncOptions>(options || {}, getExclude(k))\n )\n}\n\nexport type ExecFileArgs =\n | []\n | [\n options:\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n | undefined\n | null\n ]\n | [args?: ReadonlyArray<string> | null]\n | [\n args: ReadonlyArray<string> | undefined | null,\n options:\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n | undefined\n | null\n ]\n | [\n callback: (\n error: ExecFileException | null,\n stdout: string,\n stderr: string\n ) => void\n ]\n | [\n args: ReadonlyArray<string> | undefined | null,\n callback: (\n error: ExecFileException | null,\n stdout: string,\n stderr: string\n ) => void\n ]\n | [\n options: WithExternalID<ExecFileOptionsWithBufferEncoding>,\n callback: (\n error: ExecFileException | null,\n stdout: Buffer,\n stderr: Buffer\n ) => void\n ]\n | [\n args: ReadonlyArray<string> | undefined | null,\n options: WithExternalID<ExecFileOptionsWithBufferEncoding>,\n callback: (\n error: ExecFileException | null,\n stdout: Buffer,\n stderr: Buffer\n ) => void\n ]\n | [\n options: WithExternalID<ExecFileOptionsWithStringEncoding>,\n callback: (\n error: ExecFileException | null,\n stdout: string,\n stderr: string\n ) => void\n ]\n | [\n args: ReadonlyArray<string> | undefined | null,\n options: WithExternalID<ExecFileOptionsWithStringEncoding>,\n callback: (\n error: ExecFileException | null,\n stdout: string,\n stderr: string\n ) => void\n ]\n | [\n options: WithExternalID<ExecFileOptionsWithOtherEncoding>,\n callback: (\n error: ExecFileException | null,\n stdout: string | Buffer,\n stderr: string | Buffer\n ) => void\n ]\n | [\n args: ReadonlyArray<string> | undefined | null,\n options: WithExternalID<ExecFileOptionsWithOtherEncoding>,\n callback: (\n error: ExecFileException | null,\n stdout: string | Buffer,\n stderr: string | Buffer\n ) => void\n ]\n | [\n options: WithExternalID<ExecFileOptions>,\n callback: (\n error: ExecFileException | null,\n stdout: string,\n stderr: string\n ) => void\n ]\n | [\n args: ReadonlyArray<string> | undefined | null,\n options: WithExternalID<ExecFileOptions>,\n callback: (\n error: ExecFileException | null,\n stdout: string,\n stderr: string\n ) => void\n ]\n | [\n options:\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n | undefined\n | null,\n callback:\n | ((\n error: ExecFileException | null,\n stdout: string | Buffer,\n stderr: string | Buffer\n ) => void)\n | undefined\n | null\n ]\n | [\n args: ReadonlyArray<string> | undefined | null,\n options:\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n | undefined\n | null,\n callback:\n | ((\n error: ExecFileException | null,\n stdout: string | Buffer,\n stderr: string | Buffer\n ) => void)\n | undefined\n | null\n ]\nexport function execFile(\n file: string,\n ...execFileArgs: ExecFileArgs\n): ChildProcess {\n let args = []\n let options: WithExternalID<ObjectEncodingOptions & ExecFileOptions> = {}\n let callback: ((...a: any) => any) | undefined = undefined\n for (const arg of execFileArgs) {\n if (Array.isArray(arg)) {\n args = arg\n } else if (\n arg &&\n typeof arg === 'object' &&\n isNotArray<WithExternalID<ObjectEncodingOptions & ExecFileOptions>>(\n arg\n )\n ) {\n options = arg\n } else if (typeof arg === 'function') {\n callback = arg\n }\n }\n return cpExecFile(\n file,\n args,\n spawnOpts(options, getExclude(k)),\n callback\n )\n}\n\nexport namespace execFile {\n export function __promisify__(file: string): PromiseWithChild<{\n stdout: string\n stderr: string\n }>\n export function __promisify__(\n file: string,\n args: ReadonlyArray<string> | undefined | null\n ): PromiseWithChild<{\n stdout: string\n stderr: string\n }>\n export function __promisify__(\n file: string,\n options: WithExternalID<ExecFileOptionsWithBufferEncoding>\n ): PromiseWithChild<{\n stdout: Buffer\n stderr: Buffer\n }>\n export function __promisify__(\n file: string,\n args: ReadonlyArray<string> | undefined | null,\n options: WithExternalID<ExecFileOptionsWithBufferEncoding>\n ): PromiseWithChild<{\n stdout: Buffer\n stderr: Buffer\n }>\n export function __promisify__(\n file: string,\n options: WithExternalID<ExecFileOptionsWithStringEncoding>\n ): PromiseWithChild<{\n stdout: string\n stderr: string\n }>\n export function __promisify__(\n file: string,\n args: ReadonlyArray<string> | undefined | null,\n options: WithExternalID<ExecFileOptionsWithStringEncoding>\n ): PromiseWithChild<{\n stdout: string\n stderr: string\n }>\n export function __promisify__(\n file: string,\n options: WithExternalID<ExecFileOptionsWithOtherEncoding>\n ): PromiseWithChild<{\n stdout: string | Buffer\n stderr: string | Buffer\n }>\n export function __promisify__(\n file: string,\n args: ReadonlyArray<string> | undefined | null,\n options: WithExternalID<ExecFileOptionsWithOtherEncoding>\n ): PromiseWithChild<{\n stdout: string | Buffer\n stderr: string | Buffer\n }>\n export function __promisify__(\n file: string,\n options: WithExternalID<ExecFileOptions>\n ): PromiseWithChild<{\n stdout: string\n stderr: string\n }>\n export function __promisify__(\n file: string,\n args: ReadonlyArray<string> | undefined | null,\n options: WithExternalID<ExecFileOptions>\n ): PromiseWithChild<{\n stdout: string\n stderr: string\n }>\n export function __promisify__(\n file: string,\n options:\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n | undefined\n | null\n ): PromiseWithChild<{\n stdout: string | Buffer\n stderr: string | Buffer\n }>\n export function __promisify__(\n file: string,\n args: ReadonlyArray<string> | undefined | null,\n options:\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n | undefined\n | null\n ): PromiseWithChild<{\n stdout: string | Buffer\n stderr: string | Buffer\n }>\n export function __promisify__(\n file: string,\n args?:\n | ReadonlyArray<string>\n | undefined\n | null\n | WithExternalID<ExecFileOptionsWithBufferEncoding>\n | WithExternalID<ExecFileOptionsWithStringEncoding>\n | WithExternalID<ExecFileOptionsWithOtherEncoding>\n | WithExternalID<ExecFileOptions>\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>,\n options?:\n | undefined\n | null\n | WithExternalID<ExecFileOptionsWithBufferEncoding>\n | WithExternalID<ExecFileOptionsWithStringEncoding>\n | WithExternalID<ExecFileOptionsWithOtherEncoding>\n | WithExternalID<ExecFileOptions>\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n ): PromiseWithChild<{\n stdout: string | Buffer\n stderr: string | Buffer\n }> {\n if (\n !!args &&\n typeof args === 'object' &&\n isNotArray<\n | WithExternalID<ExecFileOptionsWithBufferEncoding>\n | WithExternalID<ExecFileOptionsWithStringEncoding>\n | WithExternalID<ExecFileOptionsWithOtherEncoding>\n | WithExternalID<ExecFileOptions>\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n | WithExternalID<ObjectEncodingOptions & ExecFileOptions>\n >(args)\n ) {\n options = args\n args = []\n }\n return customPromisify(cpExecFile)(\n file,\n spawnOpts(options || {}, getExclude(k))\n )\n }\n Object.assign(execFile, { [promisify]: __promisify__ })\n /* c8 ignore start */\n}\n/* c8 ignore stop */\n\nexport function execFileSync(file: string): Buffer\nexport function execFileSync(\n file: string,\n options: WithExternalID<ExecFileSyncOptionsWithStringEncoding>\n): string\nexport function execFileSync(\n file: string,\n options: WithExternalID<ExecFileSyncOptionsWithBufferEncoding>\n): Buffer\nexport function execFileSync(\n file: string,\n options?: WithExternalID<ExecFileSyncOptions>\n): string | Buffer\nexport function execFileSync(\n file: string,\n args: ReadonlyArray<string>\n): Buffer\nexport function execFileSync(\n file: string,\n args: ReadonlyArray<string>,\n options: WithExternalID<ExecFileSyncOptionsWithStringEncoding>\n): string\nexport function execFileSync(\n file: string,\n args: ReadonlyArray<string>,\n options: WithExternalID<ExecFileSyncOptionsWithBufferEncoding>\n): Buffer\nexport function execFileSync(\n file: string,\n args?: ReadonlyArray<string>,\n options?: WithExternalID<ExecFileSyncOptions>\n): string | Buffer\nexport function execFileSync(\n file: string,\n args?:\n | ReadonlyArray<string>\n | WithExternalID<ExecFileSyncOptions>\n | WithExternalID<ExecFileSyncOptionsWithStringEncoding>\n | WithExternalID<ExecFileSyncOptionsWithBufferEncoding>,\n options?:\n | WithExternalID<ExecFileSyncOptions>\n | WithExternalID<ExecFileSyncOptionsWithStringEncoding>\n | WithExternalID<ExecFileSyncOptionsWithBufferEncoding>\n): string | Buffer {\n if (\n args &&\n typeof args === 'object' &&\n isNotArray<\n | WithExternalID<ExecFileSyncOptions>\n | WithExternalID<ExecFileSyncOptionsWithStringEncoding>\n | WithExternalID<ExecFileSyncOptionsWithBufferEncoding>\n >(args)\n ) {\n options = args\n args = []\n }\n return cpExecFileSync(\n file,\n args || [],\n spawnOpts(options || {}, getExclude(k))\n )\n}\n\nexport function fork(\n modulePath: string,\n options?: ForkOptions\n): ChildProcess\nexport function fork(\n modulePath: string,\n args?: ReadonlyArray<string>,\n options?: WithExternalID<ForkOptions>\n): ChildProcess\nexport function fork(\n modulePath: string,\n args?: ForkOptions | ReadonlyArray<string>,\n options?: WithExternalID<ForkOptions>\n): ChildProcess {\n if (isNotArray<ForkOptions>(args)) {\n options = args\n args = []\n }\n return cpFork(modulePath, args, spawnOpts(options || {}, getExclude(k)))\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import type { Serializable } from 'worker_threads';
3
+ export * from './index.js';
4
+ type GPPort = {
5
+ postMessage: (x: Serializable) => any;
6
+ };
7
+ export declare const globalPreload: (context: {
8
+ port?: GPPort;
9
+ }) => string;
10
+ export declare const load: (url: string, context: any, nextLoad: Function) => Promise<any>;
11
+ //# sourceMappingURL=esm.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esm.d.mts","sourceRoot":"","sources":["../../lib/esm.mts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAOlD,cAAc,YAAY,CAAA;AAU1B,KAAK,MAAM,GAAG;IACZ,WAAW,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,GAAG,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,aAAa,YAAa;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,WAkBvD,CAAA;AAGD,eAAO,MAAM,IAAI,QACV,MAAM,WACF,GAAG,YACF,QAAQ,iBAcnB,CAAA"}
@@ -0,0 +1,45 @@
1
+ // usage: node '--loader=@tapjs/processinfo/esm' foo.mjs
2
+ import { fileURLToPath } from 'url';
3
+ import { getExclude } from './get-exclude.js';
4
+ import { getProcessInfo } from './get-process-info.js';
5
+ import { resolve } from './require-resolve.js';
6
+ // copy main module so that we can --loader=@tapjs/processinfo and use
7
+ // this as the entry point as well.
8
+ export * from './index.js';
9
+ let PORT = undefined;
10
+ export const globalPreload = (context) => {
11
+ // this will be something like path/to/dist/mjs/lib/esm.mjs
12
+ // but we need path/to/dist/cjs/cjs.js
13
+ const base = resolve('../cjs/cjs.js');
14
+ const { port } = context || {};
15
+ PORT = port;
16
+ return `
17
+ if (typeof port !== 'undefined') {
18
+ const { createRequire } = getBuiltin('module')
19
+ const require = createRequire(${JSON.stringify(base)})
20
+ const { getProcessInfo } = require('./get-process-info.js')
21
+ // must be called eagerly here.
22
+ // this does all the registration as well.
23
+ const processInfo = getProcessInfo()
24
+ port.onmessage = (e) => processInfo.files.push(e.data)
25
+ port.unref()
26
+ }
27
+ `;
28
+ };
29
+ const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_');
30
+ export const load = async (url, context, nextLoad) => {
31
+ if (/^file:/.test(url)) {
32
+ const filename = fileURLToPath(url);
33
+ if (!exclude.test(filename)) {
34
+ if (PORT) {
35
+ PORT.postMessage(filename);
36
+ }
37
+ else {
38
+ // call lazily so we don't double-register
39
+ getProcessInfo().files.push(filename);
40
+ }
41
+ }
42
+ }
43
+ return nextLoad(url, context);
44
+ };
45
+ //# sourceMappingURL=esm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esm.mjs","sourceRoot":"","sources":["../../lib/esm.mts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,sEAAsE;AACtE,mCAAmC;AACnC,cAAc,YAAY,CAAA;AAa1B,IAAI,IAAI,GAAuB,SAAS,CAAA;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAA0B,EAAE,EAAE;IAC1D,2DAA2D;IAC3D,sCAAsC;IACtC,MAAM,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,CAAA;IAC9B,IAAI,GAAG,IAAI,CAAA;IACX,OAAO;;;kCAGyB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;;;;;;;;CAQrD,CAAA;AACD,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,UAAU,CAAC,6BAA6B,CAAC,CAAA;AACzD,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EACvB,GAAW,EACX,OAAY,EACZ,QAAkB,EAClB,EAAE;IACF,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACtB,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;QACnC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC3B,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;aAC3B;iBAAM;gBACL,0CAA0C;gBAC1C,cAAc,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;aACtC;SACF;KACF;IACD,OAAO,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;AAC/B,CAAC,CAAA","sourcesContent":["// usage: node '--loader=@tapjs/processinfo/esm' foo.mjs\nimport { fileURLToPath } from 'url'\nimport type { Serializable } from 'worker_threads'\nimport { getExclude } from './get-exclude.js'\nimport { getProcessInfo } from './get-process-info.js'\nimport { resolve } from './require-resolve.js'\n\n// copy main module so that we can --loader=@tapjs/processinfo and use\n// this as the entry point as well.\nexport * from './index.js'\n\n// on Node v20, loaders are executed in a separate isolated environment\n// As a result, to register coverage and track files, we need to act in\n// the globalPreload function. The load() method posts a message with the\n// filename being loaded, because any registrations that happen in the\n// loader thread will not have any effect.\n// The check for the 'port' being undefined is to allow for support back to\n// 16.12, which had a globalPreload method, but did not have a sendMessage\n// port in that environment.\ntype GPPort = {\n postMessage: (x: Serializable) => any\n}\nlet PORT: undefined | GPPort = undefined\nexport const globalPreload = (context: { port?: GPPort }) => {\n // this will be something like path/to/dist/mjs/lib/esm.mjs\n // but we need path/to/dist/cjs/cjs.js\n const base = resolve('../cjs/cjs.js')\n const { port } = context || {}\n PORT = port\n return `\nif (typeof port !== 'undefined') {\n const { createRequire } = getBuiltin('module')\n const require = createRequire(${JSON.stringify(base)})\n const { getProcessInfo } = require('./get-process-info.js')\n // must be called eagerly here.\n // this does all the registration as well.\n const processInfo = getProcessInfo()\n port.onmessage = (e) => processInfo.files.push(e.data)\n port.unref()\n}\n`\n}\n\nconst exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_')\nexport const load = async (\n url: string,\n context: any,\n nextLoad: Function\n) => {\n if (/^file:/.test(url)) {\n const filename = fileURLToPath(url)\n if (!exclude.test(filename)) {\n if (PORT) {\n PORT.postMessage(filename)\n } else {\n // call lazily so we don't double-register\n getProcessInfo().files.push(filename)\n }\n }\n }\n return nextLoad(url, context)\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export declare const defaultExclude: RegExp;
2
+ export declare const getExclude: (k: string) => RegExp;
3
+ //# sourceMappingURL=get-exclude.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-exclude.d.ts","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QACuG,CAAA;AAYlI,eAAO,MAAM,UAAU,MAAO,MAAM,WAKnC,CAAA"}
@@ -0,0 +1,19 @@
1
+ export const defaultExclude = /(^|[\\\/])(node_modules|\.tap|tap-testdir-.*?|tap-snapshots|tests?|[^\\\/]+\.test\.([cm]?[jt]s|[jt]sx?)|__tests?__)([\\\/]|$)/i;
2
+ const parseExclude = (src) => {
3
+ if (!src)
4
+ return;
5
+ const parsed = src.match(/^\/(.*)\/([a-z]*)$/);
6
+ if (parsed) {
7
+ try {
8
+ return new RegExp(parsed[1], parsed[2]);
9
+ }
10
+ catch (e) { }
11
+ }
12
+ };
13
+ export const getExclude = (k) => {
14
+ const src = process.env[k];
15
+ const exclude = parseExclude(src) || defaultExclude;
16
+ process.env[k] = String(exclude);
17
+ return exclude;
18
+ };
19
+ //# sourceMappingURL=get-exclude.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-exclude.js","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GACzB,gIAAgI,CAAA;AAElI,MAAM,YAAY,GAAG,CAAC,GAAuB,EAAsB,EAAE;IACnE,IAAI,CAAC,GAAG;QAAE,OAAM;IAChB,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;IAC9C,IAAI,MAAM,EAAE;QACV,IAAI;YACF,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE,GAAE;KACf;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,EAAE;IACtC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC1B,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,cAAc,CAAA;IACnD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAChC,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA","sourcesContent":["export const defaultExclude =\n /(^|[\\\\\\/])(node_modules|\\.tap|tap-testdir-.*?|tap-snapshots|tests?|[^\\\\\\/]+\\.test\\.([cm]?[jt]s|[jt]sx?)|__tests?__)([\\\\\\/]|$)/i\n\nconst parseExclude = (src: string | undefined): RegExp | undefined => {\n if (!src) return\n const parsed = src.match(/^\\/(.*)\\/([a-z]*)$/)\n if (parsed) {\n try {\n return new RegExp(parsed[1], parsed[2])\n } catch (e) {}\n }\n}\n\nexport const getExclude = (k: string) => {\n const src = process.env[k]\n const exclude = parseExclude(src) || defaultExclude\n process.env[k] = String(exclude)\n return exclude\n}\n"]}
@@ -0,0 +1,25 @@
1
+ /// <reference types="node" />
2
+ export interface ProcessInfoNodeData {
3
+ hrstart?: [number, number];
4
+ date: string;
5
+ argv: string[];
6
+ execArgv: string[];
7
+ NODE_OPTIONS?: string;
8
+ cwd: string;
9
+ pid: number;
10
+ ppid: number;
11
+ parent: string | null;
12
+ uuid: string;
13
+ files: string[];
14
+ root?: string | null;
15
+ externalID?: string | null;
16
+ code?: number | null;
17
+ signal?: NodeJS.Signals | null;
18
+ runtime?: number;
19
+ globalsAdded?: string[];
20
+ }
21
+ export declare const reset: () => {
22
+ getProcessInfo: () => ProcessInfoNodeData;
23
+ };
24
+ export declare const getProcessInfo: () => ProcessInfoNodeData;
25
+ //# sourceMappingURL=get-process-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-process-info.d.ts","sourceRoot":"","sources":["../../lib/get-process-info.ts"],"names":[],"mappings":";AAOA,MAAM,WAAW,mBAAmB;IAElC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAG1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,EAAE,CAAA;IAGf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB;AA2BD,eAAO,MAAM,KAAK;0BAKgB,mBAAmB;CAFpD,CAAA;AAED,eAAO,MAAM,cAAc,QAAO,mBAsCjC,CAAA"}
@@ -0,0 +1,64 @@
1
+ // we always want this
2
+ const p = process;
3
+ p.setSourceMapsEnabled(true);
4
+ import { v4 as uuid } from 'uuid';
5
+ const envKey = (k) => `_TAPJS_PROCESSINFO_${k.toUpperCase()}_`;
6
+ const getEnv = (k) => process.env[envKey(k)];
7
+ const setEnv = (k, v) => (process.env[envKey(k)] = v);
8
+ const delEnv = (k) => delete process.env[envKey(k)];
9
+ import { register as registerCoverage } from './register-coverage.js';
10
+ import { register as registerEnv } from './register-env.js';
11
+ import { register as registerProcessEnd } from './register-process-end.js';
12
+ import { register as registerCJS } from './register-cjs.js';
13
+ // this module is hybridized. In node v20, it's the *commonjs* one that
14
+ // gets loaded, because the esm loader context can't modify the main thread
15
+ // except via communication over the port to the globalPreload env.
16
+ // So, we have to store our singleton on the global.
17
+ //
18
+ // If it later loads the esm form of this module, that's fine, because it'll
19
+ // see the global processInfo object, and not re-register anything.
20
+ const kProcessInfo = Symbol.for('@tapjs/processinfo.ProcessInfoNodeData');
21
+ const g = global;
22
+ // only used for tests so we can simulate multiple processes
23
+ export const reset = () => {
24
+ g[kProcessInfo] = undefined;
25
+ return { getProcessInfo };
26
+ };
27
+ export const getProcessInfo = () => {
28
+ if (g[kProcessInfo])
29
+ return g[kProcessInfo];
30
+ g[kProcessInfo] = {
31
+ hrstart: process.hrtime(),
32
+ date: new Date().toISOString(),
33
+ argv: process.argv,
34
+ execArgv: process.execArgv,
35
+ NODE_OPTIONS: process.env.NODE_OPTIONS,
36
+ cwd: process.cwd(),
37
+ pid: process.pid,
38
+ ppid: process.ppid,
39
+ parent: getEnv('parent') || null,
40
+ uuid: uuid(),
41
+ files: [],
42
+ };
43
+ if (!g[kProcessInfo].parent) {
44
+ g[kProcessInfo].root = g[kProcessInfo].uuid;
45
+ setEnv('root', g[kProcessInfo].uuid);
46
+ }
47
+ else {
48
+ g[kProcessInfo].root = getEnv('root');
49
+ }
50
+ // this is the parent of any further child processes
51
+ setEnv('parent', g[kProcessInfo].uuid);
52
+ const externalID = getEnv('external_id');
53
+ if (externalID) {
54
+ g[kProcessInfo].externalID = externalID;
55
+ // externalID only applies to ONE process, not all its children.
56
+ delEnv('external_id');
57
+ }
58
+ registerCJS();
59
+ registerEnv();
60
+ registerCoverage();
61
+ registerProcessEnd();
62
+ return g[kProcessInfo];
63
+ };
64
+ //# sourceMappingURL=get-process-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-process-info.js","sourceRoot":"","sources":["../../lib/get-process-info.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,MAAM,CAAC,GAAG,OAET,CAAA;AACD,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;AAE5B,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAA;AA2BjC,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,sBAAsB,CAAC,CAAC,WAAW,EAAE,GAAG,CAAA;AACtE,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpD,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;AACrE,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AAE3D,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,2BA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CAAC,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAA;KACrC;SAAM;QACL,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;KACtC;IACD,oDAAoD;IACpD,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAA;IACtC,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;IACxC,IAAI,UAAU,EAAE;QACd,CAAC,CAAC,YAAY,CAAC,CAAC,UAAU,GAAG,UAAU,CAAA;QACvC,gEAAgE;QAChE,MAAM,CAAC,aAAa,CAAC,CAAA;KACtB;IAED,WAAW,EAAE,CAAA;IACb,WAAW,EAAE,CAAA;IACb,gBAAgB,EAAE,CAAA;IAClB,kBAAkB,EAAE,CAAA;IAEpB,OAAO,CAAC,CAAC,YAAY,CAAC,CAAA;AACxB,CAAC,CAAA","sourcesContent":["// we always want this\nconst p = process as NodeJS.Process & {\n setSourceMapsEnabled(v: boolean): void\n}\np.setSourceMapsEnabled(true)\n\nimport { v4 as uuid } from 'uuid'\nexport interface ProcessInfoNodeData {\n // set initially, but deleted before it is written\n hrstart?: [number, number]\n\n // always set\n date: string\n argv: string[]\n execArgv: string[]\n NODE_OPTIONS?: string\n cwd: string\n pid: number\n ppid: number\n parent: string | null\n uuid: string\n files: string[]\n\n // fields that are only set when the process completes\n root?: string | null\n externalID?: string | null\n code?: number | null\n signal?: NodeJS.Signals | null\n runtime?: number\n globalsAdded?: string[]\n}\n\n\nconst envKey = (k: string) => `_TAPJS_PROCESSINFO_${k.toUpperCase()}_`\nconst getEnv = (k: string) => process.env[envKey(k)]\nconst setEnv = (k: string, v: string) => (process.env[envKey(k)] = v)\nconst delEnv = (k: string) => delete process.env[envKey(k)]\n\nimport { register as registerCoverage } from './register-coverage.js'\nimport { register as registerEnv } from './register-env.js'\nimport { register as registerProcessEnd } from './register-process-end.js'\nimport { register as registerCJS } from './register-cjs.js'\n\n// this module is hybridized. In node v20, it's the *commonjs* one that\n// gets loaded, because the esm loader context can't modify the main thread\n// except via communication over the port to the globalPreload env.\n// So, we have to store our singleton on the global.\n//\n// If it later loads the esm form of this module, that's fine, because it'll\n// see the global processInfo object, and not re-register anything.\n\nconst kProcessInfo = Symbol.for('@tapjs/processinfo.ProcessInfoNodeData')\nconst g = global as typeof globalThis & {\n [kProcessInfo]?: ProcessInfoNodeData\n}\n\n// only used for tests so we can simulate multiple processes\nexport const reset = () => {\n g[kProcessInfo] = undefined\n return { getProcessInfo }\n}\n\nexport const getProcessInfo = (): ProcessInfoNodeData => {\n if (g[kProcessInfo]) return g[kProcessInfo]\n\n g[kProcessInfo] = {\n hrstart: process.hrtime(),\n date: new Date().toISOString(),\n argv: process.argv,\n execArgv: process.execArgv,\n NODE_OPTIONS: process.env.NODE_OPTIONS,\n cwd: process.cwd(),\n pid: process.pid,\n ppid: process.ppid,\n parent: getEnv('parent') || null,\n uuid: uuid(),\n files: [],\n }\n\n if (!g[kProcessInfo].parent) {\n g[kProcessInfo].root = g[kProcessInfo].uuid\n setEnv('root', g[kProcessInfo].uuid)\n } else {\n g[kProcessInfo].root = getEnv('root')\n }\n // this is the parent of any further child processes\n setEnv('parent', g[kProcessInfo].uuid)\n const externalID = getEnv('external_id')\n if (externalID) {\n g[kProcessInfo].externalID = externalID\n // externalID only applies to ONE process, not all its children.\n delEnv('external_id')\n }\n\n registerCJS()\n registerEnv()\n registerCoverage()\n registerProcessEnd()\n\n return g[kProcessInfo]\n}\n"]}