@tapjs/processinfo 1.0.12 → 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.
- package/README.md +20 -11
- package/dist/cjs/argv-to-node-options.d.ts +2 -0
- package/dist/cjs/argv-to-node-options.d.ts.map +1 -0
- package/dist/cjs/argv-to-node-options.js +6 -0
- package/dist/cjs/argv-to-node-options.js.map +1 -0
- package/dist/cjs/child_process.d.ts +205 -0
- package/dist/cjs/child_process.d.ts.map +1 -0
- package/dist/cjs/child_process.js +109 -0
- package/dist/cjs/child_process.js.map +1 -0
- package/dist/cjs/cjs.d.ts +2 -0
- package/dist/cjs/cjs.d.ts.map +1 -0
- package/dist/cjs/cjs.js +5 -0
- package/dist/cjs/cjs.js.map +1 -0
- package/dist/cjs/get-exclude.d.ts +3 -0
- package/dist/cjs/get-exclude.d.ts.map +1 -0
- package/dist/cjs/get-exclude.js +23 -0
- package/dist/cjs/get-exclude.js.map +1 -0
- package/dist/cjs/get-process-info.d.ts +25 -0
- package/dist/cjs/get-process-info.d.ts.map +1 -0
- package/dist/cjs/get-process-info.js +69 -0
- package/dist/cjs/get-process-info.js.map +1 -0
- package/dist/cjs/index.d.ts +44 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +148 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/json-file.d.ts +3 -0
- package/dist/cjs/json-file.d.ts.map +1 -0
- package/dist/cjs/json-file.js +20 -0
- package/dist/cjs/json-file.js.map +1 -0
- package/dist/cjs/loader-paths.d.ts +5 -0
- package/dist/cjs/loader-paths.d.ts.map +1 -0
- package/dist/cjs/loader-paths.js +35 -0
- package/dist/cjs/loader-paths.js.map +1 -0
- package/dist/cjs/node-options-env.d.ts +6 -0
- package/dist/cjs/node-options-env.d.ts.map +1 -0
- package/dist/cjs/node-options-env.js +58 -0
- package/dist/cjs/node-options-env.js.map +1 -0
- package/dist/cjs/node-options-to-argv.d.ts +2 -0
- package/dist/cjs/node-options-to-argv.d.ts.map +1 -0
- package/dist/cjs/node-options-to-argv.js +58 -0
- package/dist/cjs/node-options-to-argv.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/process-info-node.d.ts +24 -0
- package/dist/cjs/process-info-node.d.ts.map +1 -0
- package/dist/cjs/process-info-node.js +100 -0
- package/dist/cjs/process-info-node.js.map +1 -0
- package/dist/cjs/register-cjs.d.ts +2 -0
- package/dist/cjs/register-cjs.d.ts.map +1 -0
- package/dist/cjs/register-cjs.js +21 -0
- package/dist/cjs/register-cjs.js.map +1 -0
- package/dist/cjs/register-coverage.d.ts +7 -0
- package/dist/cjs/register-coverage.d.ts.map +1 -0
- package/dist/cjs/register-coverage.js +94 -0
- package/dist/cjs/register-coverage.js.map +1 -0
- package/dist/cjs/register-env.d.ts +2 -0
- package/dist/cjs/register-env.d.ts.map +1 -0
- package/dist/cjs/register-env.js +26 -0
- package/dist/cjs/register-env.js.map +1 -0
- package/dist/cjs/register-process-end.d.ts +2 -0
- package/dist/cjs/register-process-end.d.ts.map +1 -0
- package/dist/cjs/register-process-end.js +30 -0
- package/dist/cjs/register-process-end.js.map +1 -0
- package/dist/cjs/require-resolve-cjs.d.ts.map +1 -0
- package/dist/cjs/require-resolve-cjs.js.map +1 -0
- package/dist/cjs/require-resolve.d.ts +3 -0
- package/dist/cjs/require-resolve.js +9 -0
- package/dist/cjs/spawn-opts.d.ts +10 -0
- package/dist/cjs/spawn-opts.d.ts.map +1 -0
- package/dist/cjs/spawn-opts.js +18 -0
- package/dist/cjs/spawn-opts.js.map +1 -0
- package/dist/cjs/x.d.ts +2 -0
- package/dist/cjs/x.d.ts.map +1 -0
- package/dist/cjs/x.js +5 -0
- package/dist/cjs/x.js.map +1 -0
- package/dist/mjs/argv-to-node-options.d.ts +2 -0
- package/dist/mjs/argv-to-node-options.d.ts.map +1 -0
- package/dist/mjs/argv-to-node-options.js +2 -0
- package/dist/mjs/argv-to-node-options.js.map +1 -0
- package/dist/mjs/child_process.d.ts +205 -0
- package/dist/mjs/child_process.d.ts.map +1 -0
- package/dist/mjs/child_process.js +99 -0
- package/dist/mjs/child_process.js.map +1 -0
- package/dist/mjs/esm.d.mts +11 -0
- package/dist/mjs/esm.d.mts.map +1 -0
- package/dist/mjs/esm.mjs +45 -0
- package/dist/mjs/esm.mjs.map +1 -0
- package/dist/mjs/get-exclude.d.ts +3 -0
- package/dist/mjs/get-exclude.d.ts.map +1 -0
- package/dist/mjs/get-exclude.js +19 -0
- package/dist/mjs/get-exclude.js.map +1 -0
- package/dist/mjs/get-process-info.d.ts +25 -0
- package/dist/mjs/get-process-info.d.ts.map +1 -0
- package/dist/mjs/get-process-info.js +64 -0
- package/dist/mjs/get-process-info.js.map +1 -0
- package/dist/mjs/index.d.ts +44 -0
- package/dist/mjs/index.d.ts.map +1 -0
- package/dist/mjs/index.js +130 -0
- package/dist/mjs/index.js.map +1 -0
- package/dist/mjs/json-file.d.ts +3 -0
- package/dist/mjs/json-file.d.ts.map +1 -0
- package/dist/mjs/json-file.js +15 -0
- package/dist/mjs/json-file.js.map +1 -0
- package/dist/mjs/loader-paths.d.ts +5 -0
- package/dist/mjs/loader-paths.d.ts.map +1 -0
- package/dist/mjs/loader-paths.js +30 -0
- package/dist/mjs/loader-paths.js.map +1 -0
- package/dist/mjs/node-options-env.d.ts +6 -0
- package/dist/mjs/node-options-env.d.ts.map +1 -0
- package/dist/mjs/node-options-env.js +54 -0
- package/dist/mjs/node-options-env.js.map +1 -0
- package/dist/mjs/node-options-to-argv.d.ts +2 -0
- package/dist/mjs/node-options-to-argv.d.ts.map +1 -0
- package/dist/mjs/node-options-to-argv.js +54 -0
- package/dist/mjs/node-options-to-argv.js.map +1 -0
- package/dist/mjs/package.json +3 -0
- package/dist/mjs/process-info-node.d.ts +24 -0
- package/dist/mjs/process-info-node.d.ts.map +1 -0
- package/dist/mjs/process-info-node.js +96 -0
- package/dist/mjs/process-info-node.js.map +1 -0
- package/dist/mjs/register-cjs.d.ts +2 -0
- package/dist/mjs/register-cjs.d.ts.map +1 -0
- package/dist/mjs/register-cjs.js +17 -0
- package/dist/mjs/register-cjs.js.map +1 -0
- package/dist/mjs/register-coverage.d.ts +7 -0
- package/dist/mjs/register-coverage.d.ts.map +1 -0
- package/dist/mjs/register-coverage.js +89 -0
- package/dist/mjs/register-coverage.js.map +1 -0
- package/dist/mjs/register-env.d.ts +2 -0
- package/dist/mjs/register-env.d.ts.map +1 -0
- package/dist/mjs/register-env.js +19 -0
- package/dist/mjs/register-env.js.map +1 -0
- package/dist/mjs/register-process-end.d.ts +2 -0
- package/dist/mjs/register-process-end.d.ts.map +1 -0
- package/dist/mjs/register-process-end.js +26 -0
- package/dist/mjs/register-process-end.js.map +1 -0
- package/dist/mjs/require-resolve.d.ts +3 -0
- package/dist/mjs/require-resolve.d.ts.map +1 -0
- package/dist/mjs/require-resolve.js +9 -0
- package/dist/mjs/require-resolve.js.map +1 -0
- package/dist/mjs/spawn-opts.d.ts +10 -0
- package/dist/mjs/spawn-opts.d.ts.map +1 -0
- package/dist/mjs/spawn-opts.js +14 -0
- package/dist/mjs/spawn-opts.js.map +1 -0
- package/dist/mjs/x.d.ts +2 -0
- package/dist/mjs/x.d.ts.map +1 -0
- package/dist/mjs/x.js +2 -0
- package/dist/mjs/x.js.map +1 -0
- package/package.json +49 -19
- package/index.d.ts +0 -208
- package/lib/argv-to-node-options.cjs +0 -2
- package/lib/child_process.cjs +0 -81
- package/lib/cjs.cjs +0 -16
- package/lib/esm.mjs +0 -74
- package/lib/get-exclude.cjs +0 -21
- package/lib/get-process-info.cjs +0 -45
- package/lib/index.cjs +0 -163
- package/lib/index.d.cts +0 -208
- package/lib/index.d.ts +0 -208
- package/lib/json-file.cjs +0 -19
- package/lib/node-options-env.cjs +0 -100
- package/lib/node-options-to-argv.cjs +0 -52
- package/lib/process-info-node.cjs +0 -84
- package/lib/register-coverage.cjs +0 -74
- package/lib/register-env.cjs +0 -21
- package/lib/register-process-end.cjs +0 -29
- package/lib/spawn-opts.cjs +0 -16
package/README.md
CHANGED
|
@@ -15,21 +15,31 @@ track all Node.js child processes.
|
|
|
15
15
|
|
|
16
16
|
```sh
|
|
17
17
|
# wrap both CommonJS and ESM
|
|
18
|
-
node --loader=@tapjs/processinfo
|
|
18
|
+
node --loader=@tapjs/processinfo file.js
|
|
19
19
|
|
|
20
|
-
# wrap only CommonJS
|
|
20
|
+
# wrap only CommonJS, idk why you'd want to do this, but it works
|
|
21
21
|
node --require=@tapjs/processinfo/cjs
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
To spawn a wrapped process from JavaScript, you can run:
|
|
25
25
|
|
|
26
26
|
```js
|
|
27
|
-
|
|
27
|
+
import {
|
|
28
|
+
spawn,
|
|
29
|
+
exec,
|
|
30
|
+
execFile,
|
|
31
|
+
execSync,
|
|
32
|
+
execFileSync,
|
|
33
|
+
fork,
|
|
34
|
+
} from '@tapjs/processinfo'
|
|
28
35
|
// any of these will work
|
|
29
|
-
const childProcess =
|
|
30
|
-
const childProcess =
|
|
31
|
-
const childProcess =
|
|
32
|
-
const childProcess =
|
|
36
|
+
const childProcess = spawn(cmd, args, options)
|
|
37
|
+
const childProcess = exec(cmd, options, callback)
|
|
38
|
+
const childProcess = execFile(cmd, options, callback)
|
|
39
|
+
const childProcess = spawnSync(cmd, args, options)
|
|
40
|
+
const childProcess = execSync(cmd, options)
|
|
41
|
+
const childProcess = execFileSync(cmd, options)
|
|
42
|
+
const childProcess = fork(cmd, options)
|
|
33
43
|
```
|
|
34
44
|
|
|
35
45
|
The `cmd` and `args` parameters are identical to the methods from the
|
|
@@ -48,7 +58,6 @@ To load the process info data, use the exported `ProcessInfo` class.
|
|
|
48
58
|
```js
|
|
49
59
|
const ProcessInfo = require('@tapjs/processinfo')
|
|
50
60
|
|
|
51
|
-
const processInfo = new ProcessInfo()
|
|
52
61
|
// returns
|
|
53
62
|
// {
|
|
54
63
|
// roots: Set([ProcessInfo.Node, ...]) for each root process group
|
|
@@ -74,14 +83,14 @@ const processInfo = new ProcessInfo()
|
|
|
74
83
|
// signal: terminating signal or null,
|
|
75
84
|
// runtime: high resolution run time in ms,
|
|
76
85
|
// }
|
|
77
|
-
const
|
|
86
|
+
const processInfoDB = await ProcessInfo.load()
|
|
78
87
|
// say we wanted to find all the files loaded by the process 'foo'
|
|
79
|
-
const proc =
|
|
88
|
+
const proc = processInfoDB.externalIDs.get('foo')
|
|
80
89
|
console.error(`Files loaded by process named 'foo':`, proc.files)
|
|
81
90
|
|
|
82
91
|
// now let's find all any other named processes that loaded them
|
|
83
92
|
for (const f of proc.files) {
|
|
84
|
-
for (const otherProc of
|
|
93
|
+
for (const otherProc of processInfoDB.files.get(f)) {
|
|
85
94
|
// walk up the tree looking for a named process
|
|
86
95
|
for (let parent = otherProc; parent; parent = parent.parent) {
|
|
87
96
|
if (parent.externalID && parent !== proc) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argv-to-node-options.d.ts","sourceRoot":"","sources":["../../lib/argv-to-node-options.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,SAAU,MAAM,EAAE,WACQ,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.argvToNodeOptions = void 0;
|
|
4
|
+
const argvToNodeOptions = (argv) => argv.map(o => `"${o.replace(/"/g, '\\"')}"`).join(' ');
|
|
5
|
+
exports.argvToNodeOptions = argvToNodeOptions;
|
|
6
|
+
//# sourceMappingURL=argv-to-node-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argv-to-node-options.js","sourceRoot":"","sources":["../../lib/argv-to-node-options.ts"],"names":[],"mappings":";;;AAAO,MAAM,iBAAiB,GAAG,CAAC,IAAc,EAAE,EAAE,CAClD,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAD3C,QAAA,iBAAiB,qBAC0B","sourcesContent":["export const argvToNodeOptions = (argv: string[]) =>\n argv.map(o => `\"${o.replace(/\"/g, '\\\\\"')}\"`).join(' ')\n"]}
|
|
@@ -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,C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AAC,MAAM,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,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fork = exports.execFileSync = exports.execFile = exports.execSync = exports.exec = exports.spawnSync = exports.spawn = void 0;
|
|
4
|
+
// This wraps all of the various spawn methods such that externalID can be
|
|
5
|
+
// set in the options, and ensuring that the proper envs get set.
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const get_exclude_js_1 = require("./get-exclude.js");
|
|
8
|
+
const spawn_opts_js_1 = require("./spawn-opts.js");
|
|
9
|
+
const promisify = Symbol.for('nodejs.util.promisify.custom');
|
|
10
|
+
const customPromisify = (e) =>
|
|
11
|
+
// the node types list it as __promisify__ but it's actually the symbol
|
|
12
|
+
/* c8 ignore start */
|
|
13
|
+
e[promisify] || e.__promisify__;
|
|
14
|
+
/* c8 ignore stop */
|
|
15
|
+
const k = '_TAPJS_PROCESSINFO_EXCLUDE_';
|
|
16
|
+
// coercion function when we know it's an array or something else
|
|
17
|
+
const isNotArray = (o) => !!o && typeof o === 'object' && !Array.isArray(o);
|
|
18
|
+
function spawn(cmd, args, options) {
|
|
19
|
+
if (isNotArray(args)) {
|
|
20
|
+
options = args;
|
|
21
|
+
args = [];
|
|
22
|
+
}
|
|
23
|
+
return (0, child_process_1.spawn)(cmd, args || [], (0, spawn_opts_js_1.spawnOpts)(options || {}, (0, get_exclude_js_1.getExclude)(k)));
|
|
24
|
+
}
|
|
25
|
+
exports.spawn = spawn;
|
|
26
|
+
function spawnSync(cmd, args, options) {
|
|
27
|
+
if (isNotArray(args)) {
|
|
28
|
+
options = args;
|
|
29
|
+
args = [];
|
|
30
|
+
}
|
|
31
|
+
return (0, child_process_1.spawnSync)(cmd, args || [], (0, spawn_opts_js_1.spawnOpts)(options || {}, (0, get_exclude_js_1.getExclude)(k)));
|
|
32
|
+
}
|
|
33
|
+
exports.spawnSync = spawnSync;
|
|
34
|
+
function exec(...args) {
|
|
35
|
+
const [cmd, options, callback] = args;
|
|
36
|
+
if (typeof options === 'function') {
|
|
37
|
+
return (0, child_process_1.exec)(cmd, (0, spawn_opts_js_1.spawnOpts)({}, (0, get_exclude_js_1.getExclude)(k)), options);
|
|
38
|
+
}
|
|
39
|
+
else if (!options) {
|
|
40
|
+
return (0, child_process_1.exec)(cmd, (0, spawn_opts_js_1.spawnOpts)({}, (0, get_exclude_js_1.getExclude)(k)), callback);
|
|
41
|
+
}
|
|
42
|
+
return (0, child_process_1.exec)(cmd, (0, spawn_opts_js_1.spawnOpts)(options, (0, get_exclude_js_1.getExclude)(k)), callback);
|
|
43
|
+
}
|
|
44
|
+
exports.exec = exec;
|
|
45
|
+
(function (exec) {
|
|
46
|
+
function __promisify__(command, options) {
|
|
47
|
+
return customPromisify(child_process_1.exec)(command, (0, spawn_opts_js_1.spawnOpts)(options || {}, (0, get_exclude_js_1.getExclude)(k)));
|
|
48
|
+
}
|
|
49
|
+
exec.__promisify__ = __promisify__;
|
|
50
|
+
Object.assign(exec, { [promisify]: __promisify__ });
|
|
51
|
+
/* c8 ignore start */
|
|
52
|
+
})(exec = exports.exec || (exports.exec = {}));
|
|
53
|
+
function execSync(cmd, options) {
|
|
54
|
+
return (0, child_process_1.execSync)(cmd, (0, spawn_opts_js_1.spawnOpts)(options || {}, (0, get_exclude_js_1.getExclude)(k)));
|
|
55
|
+
}
|
|
56
|
+
exports.execSync = execSync;
|
|
57
|
+
function execFile(file, ...execFileArgs) {
|
|
58
|
+
let args = [];
|
|
59
|
+
let options = {};
|
|
60
|
+
let callback = undefined;
|
|
61
|
+
for (const arg of execFileArgs) {
|
|
62
|
+
if (Array.isArray(arg)) {
|
|
63
|
+
args = arg;
|
|
64
|
+
}
|
|
65
|
+
else if (arg &&
|
|
66
|
+
typeof arg === 'object' &&
|
|
67
|
+
isNotArray(arg)) {
|
|
68
|
+
options = arg;
|
|
69
|
+
}
|
|
70
|
+
else if (typeof arg === 'function') {
|
|
71
|
+
callback = arg;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return (0, child_process_1.execFile)(file, args, (0, spawn_opts_js_1.spawnOpts)(options, (0, get_exclude_js_1.getExclude)(k)), callback);
|
|
75
|
+
}
|
|
76
|
+
exports.execFile = execFile;
|
|
77
|
+
(function (execFile) {
|
|
78
|
+
function __promisify__(file, args, options) {
|
|
79
|
+
if (!!args &&
|
|
80
|
+
typeof args === 'object' &&
|
|
81
|
+
isNotArray(args)) {
|
|
82
|
+
options = args;
|
|
83
|
+
args = [];
|
|
84
|
+
}
|
|
85
|
+
return customPromisify(child_process_1.execFile)(file, (0, spawn_opts_js_1.spawnOpts)(options || {}, (0, get_exclude_js_1.getExclude)(k)));
|
|
86
|
+
}
|
|
87
|
+
execFile.__promisify__ = __promisify__;
|
|
88
|
+
Object.assign(execFile, { [promisify]: __promisify__ });
|
|
89
|
+
/* c8 ignore start */
|
|
90
|
+
})(execFile = exports.execFile || (exports.execFile = {}));
|
|
91
|
+
function execFileSync(file, args, options) {
|
|
92
|
+
if (args &&
|
|
93
|
+
typeof args === 'object' &&
|
|
94
|
+
isNotArray(args)) {
|
|
95
|
+
options = args;
|
|
96
|
+
args = [];
|
|
97
|
+
}
|
|
98
|
+
return (0, child_process_1.execFileSync)(file, args || [], (0, spawn_opts_js_1.spawnOpts)(options || {}, (0, get_exclude_js_1.getExclude)(k)));
|
|
99
|
+
}
|
|
100
|
+
exports.execFileSync = execFileSync;
|
|
101
|
+
function fork(modulePath, args, options) {
|
|
102
|
+
if (isNotArray(args)) {
|
|
103
|
+
options = args;
|
|
104
|
+
args = [];
|
|
105
|
+
}
|
|
106
|
+
return (0, child_process_1.fork)(modulePath, args, (0, spawn_opts_js_1.spawnOpts)(options || {}, (0, get_exclude_js_1.getExclude)(k)));
|
|
107
|
+
}
|
|
108
|
+
exports.fork = fork;
|
|
109
|
+
//# 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,iDAmCsB;AAGtB,qDAA6C;AAC7C,mDAA2D;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,CAAC,CAAC,CAAC,I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SAAgB,IAAI,CAClB,UAAkB,EAClB,IAA0C,EAC1C,OAAqC;IAErC,IAAI,UAAU,CAAc,IAAI,CAAC,EAAE;QACjC,OAAO,GAAG,IAAI,CAAA;QACd,IAAI,GAAG,EAAE,CAAA;KACV;IACD,OAAO,IAAA,oBAAM,EAAC,UAAU,EAAE,IAAI,EAAE,IAAA,yBAAS,EAAC,OAAO,IAAI,EAAE,EAAE,IAAA,2BAAU,EAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC1E,CAAC;AAVD,oBAUC","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 @@
|
|
|
1
|
+
{"version":3,"file":"cjs.d.ts","sourceRoot":"","sources":["../../lib/cjs.ts"],"names":[],"mappings":""}
|
package/dist/cjs/cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cjs.js","sourceRoot":"","sources":["../../lib/cjs.ts"],"names":[],"mappings":";;AAAA,uDAA4C;AAC5C,IAAA,0BAAQ,GAAE,CAAA","sourcesContent":["import { register } from './register-cjs.js'\nregister()\n"]}
|
|
@@ -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,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExclude = exports.defaultExclude = void 0;
|
|
4
|
+
exports.defaultExclude = /(^|[\\\/])(node_modules|\.tap|tap-testdir-.*?|tap-snapshots|tests?|[^\\\/]+\.test\.([cm]?[jt]s|[jt]sx?)|__tests?__)([\\\/]|$)/i;
|
|
5
|
+
const parseExclude = (src) => {
|
|
6
|
+
if (!src)
|
|
7
|
+
return;
|
|
8
|
+
const parsed = src.match(/^\/(.*)\/([a-z]*)$/);
|
|
9
|
+
if (parsed) {
|
|
10
|
+
try {
|
|
11
|
+
return new RegExp(parsed[1], parsed[2]);
|
|
12
|
+
}
|
|
13
|
+
catch (e) { }
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const getExclude = (k) => {
|
|
17
|
+
const src = process.env[k];
|
|
18
|
+
const exclude = parseExclude(src) || exports.defaultExclude;
|
|
19
|
+
process.env[k] = String(exclude);
|
|
20
|
+
return exclude;
|
|
21
|
+
};
|
|
22
|
+
exports.getExclude = getExclude;
|
|
23
|
+
//# sourceMappingURL=get-exclude.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-exclude.js","sourceRoot":"","sources":["../../lib/get-exclude.ts"],"names":[],"mappings":";;;AAAa,QAAA,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;AAEM,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,sBAAc,CAAA;IACnD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAChC,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AALY,QAAA,UAAU,cAKtB","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"}
|