teen_process 3.0.6 → 4.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 (53) hide show
  1. package/build/lib/exec.d.ts +32 -107
  2. package/build/lib/exec.d.ts.map +1 -1
  3. package/build/lib/exec.js +60 -103
  4. package/build/lib/exec.js.map +1 -1
  5. package/build/lib/helpers.d.ts +1 -12
  6. package/build/lib/helpers.d.ts.map +1 -1
  7. package/build/lib/helpers.js +17 -13
  8. package/build/lib/helpers.js.map +1 -1
  9. package/build/lib/index.d.ts +4 -6
  10. package/build/lib/index.d.ts.map +1 -1
  11. package/build/lib/index.js +7 -43
  12. package/build/lib/index.js.map +1 -1
  13. package/build/lib/subprocess.d.ts +106 -61
  14. package/build/lib/subprocess.d.ts.map +1 -1
  15. package/build/lib/subprocess.js +145 -143
  16. package/build/lib/subprocess.js.map +1 -1
  17. package/build/lib/types.d.ts +79 -0
  18. package/build/lib/types.d.ts.map +1 -0
  19. package/build/lib/types.js +3 -0
  20. package/build/lib/types.js.map +1 -0
  21. package/build/test/circular-buffer-specs.d.ts +2 -0
  22. package/build/test/circular-buffer-specs.d.ts.map +1 -0
  23. package/build/test/circular-buffer-specs.js +40 -0
  24. package/build/test/circular-buffer-specs.js.map +1 -0
  25. package/build/test/exec-specs.d.ts +2 -0
  26. package/build/test/exec-specs.d.ts.map +1 -0
  27. package/build/test/exec-specs.js +167 -0
  28. package/build/test/exec-specs.js.map +1 -0
  29. package/build/test/fixtures/bigbuffer.d.ts +3 -0
  30. package/build/test/fixtures/bigbuffer.d.ts.map +1 -0
  31. package/build/test/fixtures/bigbuffer.js +13 -0
  32. package/build/test/fixtures/bigbuffer.js.map +1 -0
  33. package/build/test/helpers.d.ts +3 -0
  34. package/build/test/helpers.d.ts.map +1 -0
  35. package/build/test/helpers.js +15 -0
  36. package/build/test/helpers.js.map +1 -0
  37. package/build/test/subproc-specs.d.ts +2 -0
  38. package/build/test/subproc-specs.d.ts.map +1 -0
  39. package/build/test/subproc-specs.js +414 -0
  40. package/build/test/subproc-specs.js.map +1 -0
  41. package/build/tsconfig.tsbuildinfo +1 -0
  42. package/lib/circular-buffer.ts +1 -1
  43. package/lib/exec.ts +158 -0
  44. package/lib/helpers.ts +44 -0
  45. package/lib/index.ts +8 -0
  46. package/lib/subprocess.ts +353 -0
  47. package/lib/types.ts +95 -0
  48. package/package.json +5 -5
  49. package/index.js +0 -1
  50. package/lib/exec.js +0 -191
  51. package/lib/helpers.js +0 -38
  52. package/lib/index.js +0 -9
  53. package/lib/subprocess.js +0 -329
@@ -1,108 +1,33 @@
1
- export default exec;
2
- /**
3
- * Options on top of `SpawnOptions`, unique to `teen_process.`
4
- */
5
- export type TeenProcessProps = {
6
- /**
7
- * - Ignore & discard all output
8
- */
9
- ignoreOutput?: boolean | undefined;
10
- /**
11
- * - Return output as a Buffer
12
- */
13
- isBuffer?: boolean | undefined;
14
- /**
15
- * - Logger to use for debugging
16
- */
17
- logger?: TeenProcessLogger | undefined;
18
- /**
19
- * - Maximum size of `stdout` buffer
20
- */
21
- maxStdoutBufferSize?: number | undefined;
22
- /**
23
- * - Maximum size of `stderr` buffer
24
- */
25
- maxStderrBufferSize?: number | undefined;
26
- /**
27
- * - Encoding to use for output
28
- */
29
- encoding?: BufferEncoding | undefined;
30
- };
31
- /**
32
- * A logger object understood by {@link exec teen_process.exec}.
33
- */
34
- export type TeenProcessLogger = {
35
- debug: (...args: any[]) => void;
36
- };
37
- /**
38
- * Options for {@link exec teen_process.exec}.
39
- */
40
- export type TeenProcessExecOptions = import("child_process").SpawnOptions & TeenProcessProps;
41
- /**
42
- * The value {@link exec teen_process.exec} resolves to when `isBuffer` is `false`
43
- */
44
- export type TeenProcessExecStringResult = {
45
- /**
46
- * - Stdout
47
- */
48
- stdout: string;
49
- /**
50
- * - Stderr
51
- */
52
- stderr: string;
53
- /**
54
- * - Exit code
55
- */
56
- code: number | null;
57
- };
58
- /**
59
- * The value {@link exec teen_process.exec} resolves to when `isBuffer` is `true`
60
- */
61
- export type TeenProcessExecBufferResult = {
62
- /**
63
- * - Stdout
64
- */
65
- stdout: Buffer;
66
- /**
67
- * - Stderr
68
- */
69
- stderr: Buffer;
70
- /**
71
- * - Exit code
72
- */
73
- code: number | null;
74
- };
75
- /**
76
- * Extra props {@link exec teen_process.exec} adds to its error objects
77
- */
78
- export type TeenProcessExecErrorProps = {
79
- /**
80
- * - STDOUT
81
- */
82
- stdout: string;
83
- /**
84
- * - STDERR
85
- */
86
- stderr: string;
87
- /**
88
- * - Exit code
89
- */
90
- code: number | null;
91
- };
92
- /**
93
- * Error thrown by {@link exec teen_process.exec}
94
- */
95
- export type TeenProcessExecError = Error & TeenProcessExecErrorProps;
96
- export type BufferProp<MaybeBuffer extends {
97
- isBuffer?: boolean;
98
- }> = MaybeBuffer["isBuffer"];
99
- /**
100
- * Spawns a process
101
- * @template {TeenProcessExecOptions} T
102
- * @param {string} cmd - Program to execute
103
- * @param {string[]} [args] - Arguments to pass to the program
104
- * @param {T} [originalOpts] - Options
105
- * @returns {Promise<BufferProp<T> extends true ? TeenProcessExecBufferResult : TeenProcessExecStringResult>}
106
- */
107
- export function exec<T extends TeenProcessExecOptions>(cmd: string, args?: string[], originalOpts?: T): Promise<BufferProp<T> extends true ? TeenProcessExecBufferResult : TeenProcessExecStringResult>;
1
+ import type { TeenProcessExecOptions, TeenProcessExecResult, BufferProp } from './types';
2
+ /**
3
+ * Spawns a child process and collects its output.
4
+ *
5
+ * This is a promisified version of Node's spawn that collects stdout and stderr,
6
+ * handles timeouts, and provides error context.
7
+ *
8
+ * @template T - The options type extending TeenProcessExecOptions
9
+ * @param cmd - The command to execute
10
+ * @param args - Array of arguments to pass to the command (default: [])
11
+ * @param originalOpts - Execution options including timeout, encoding, environment, etc.
12
+ * @returns Promise resolving to an object with stdout, stderr, and exit code
13
+ *
14
+ * @throws {TeenProcessExecError} When the process exits with non-zero code or times out
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * // Simple execution
19
+ * const {stdout, stderr, code} = await exec('ls', ['-la']);
20
+ *
21
+ * // With timeout and custom encoding
22
+ * const result = await exec('long-running-cmd', [], {
23
+ * timeout: 5000,
24
+ * encoding: 'utf8',
25
+ * cwd: '/custom/path'
26
+ * });
27
+ *
28
+ * // Return output as Buffer
29
+ * const {stdout} = await exec('cat', ['image.png'], {isBuffer: true});
30
+ * ```
31
+ */
32
+ export declare function exec<T extends TeenProcessExecOptions = TeenProcessExecOptions>(cmd: string, args?: string[], originalOpts?: T): Promise<TeenProcessExecResult<BufferProp<T>>>;
108
33
  //# sourceMappingURL=exec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../lib/exec.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAqJc,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI;;;;;qCAKzB,OAAO,eAAe,EAAE,YAAY,GAAG,gBAAgB;;;;;;;;YAMtD,MAAM;;;;YACN,MAAM;;;;UACN,MAAM,OAAC;;;;;;;;;YAMP,MAAM;;;;YACN,MAAM;;;;UACN,MAAM,OAAC;;;;;;;;;YAMP,MAAM;;;;YACN,MAAM;;;;UACN,MAAM,OAAC;;;;;mCAKR,KAAK,GAAG,yBAAyB;uBAIV,WAAW,SAAlC;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,IACtB,WAAW,CAAC,UAAU,CAAC;AArLpC;;;;;;;GAOG;AACH,qBANsC,CAAC,SAAzB,sBAAuB,OAC1B,MAAM,SACN,MAAM,EAAE,iBACR,CAAC,GACC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,2BAA2B,GAAG,2BAA2B,CAAC,CAqH3G"}
1
+ {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../lib/exec.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,sBAAsB,EACtB,qBAAqB,EACrB,UAAU,EAGb,MAAM,SAAS,CAAC;AAGjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,IAAI,CAAC,CAAC,SAAS,sBAAsB,GAAG,sBAAsB,EAClF,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,YAAY,GAAE,CAAW,GACxB,OAAO,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CA4G/C"}
package/build/lib/exec.js CHANGED
@@ -4,27 +4,47 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.exec = exec;
7
- const child_process_1 = require("child_process");
7
+ const node_child_process_1 = require("node:child_process");
8
8
  const shell_quote_1 = require("shell-quote");
9
9
  const bluebird_1 = __importDefault(require("bluebird"));
10
10
  const lodash_1 = __importDefault(require("lodash"));
11
11
  const helpers_1 = require("./helpers");
12
12
  const circular_buffer_1 = require("./circular-buffer");
13
13
  /**
14
- * Spawns a process
15
- * @template {TeenProcessExecOptions} T
16
- * @param {string} cmd - Program to execute
17
- * @param {string[]} [args] - Arguments to pass to the program
18
- * @param {T} [originalOpts] - Options
19
- * @returns {Promise<BufferProp<T> extends true ? TeenProcessExecBufferResult : TeenProcessExecStringResult>}
14
+ * Spawns a child process and collects its output.
15
+ *
16
+ * This is a promisified version of Node's spawn that collects stdout and stderr,
17
+ * handles timeouts, and provides error context.
18
+ *
19
+ * @template T - The options type extending TeenProcessExecOptions
20
+ * @param cmd - The command to execute
21
+ * @param args - Array of arguments to pass to the command (default: [])
22
+ * @param originalOpts - Execution options including timeout, encoding, environment, etc.
23
+ * @returns Promise resolving to an object with stdout, stderr, and exit code
24
+ *
25
+ * @throws {TeenProcessExecError} When the process exits with non-zero code or times out
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * // Simple execution
30
+ * const {stdout, stderr, code} = await exec('ls', ['-la']);
31
+ *
32
+ * // With timeout and custom encoding
33
+ * const result = await exec('long-running-cmd', [], {
34
+ * timeout: 5000,
35
+ * encoding: 'utf8',
36
+ * cwd: '/custom/path'
37
+ * });
38
+ *
39
+ * // Return output as Buffer
40
+ * const {stdout} = await exec('cat', ['image.png'], {isBuffer: true});
41
+ * ```
20
42
  */
21
- async function exec(cmd, args = [], originalOpts = /** @type {T} */ ({})) {
43
+ async function exec(cmd, args = [], originalOpts = {}) {
22
44
  // get a quoted representation of the command for error strings
23
45
  const rep = (0, shell_quote_1.quote)([cmd, ...args]);
24
- // extend default options; we're basically re-implementing exec's options
25
- // for use here with spawn under the hood
26
- const opts = /** @type {T} */ (lodash_1.default.defaults(originalOpts, {
27
- timeout: null,
46
+ const defaults = {
47
+ timeout: undefined,
28
48
  encoding: 'utf8',
29
49
  killSignal: 'SIGTERM',
30
50
  cwd: undefined,
@@ -36,141 +56,78 @@ async function exec(cmd, args = [], originalOpts = /** @type {T} */ ({})) {
36
56
  logger: undefined,
37
57
  maxStdoutBufferSize: circular_buffer_1.MAX_BUFFER_SIZE,
38
58
  maxStderrBufferSize: circular_buffer_1.MAX_BUFFER_SIZE,
39
- }));
59
+ };
60
+ const opts = lodash_1.default.defaults({}, originalOpts, defaults);
40
61
  const isBuffer = Boolean(opts.isBuffer);
41
- // this is an async function, so return a promise
42
62
  return await new bluebird_1.default((resolve, reject) => {
43
- // spawn the child process with options; we don't currently expose any of
44
- // the other 'spawn' options through the API
45
- const proc = (0, child_process_1.spawn)(cmd, args, { cwd: opts.cwd, env: opts.env, shell: opts.shell });
63
+ const proc = (0, node_child_process_1.spawn)(cmd, args, { cwd: opts.cwd, env: opts.env, shell: opts.shell });
46
64
  const stdoutBuffer = new circular_buffer_1.CircularBuffer(opts.maxStdoutBufferSize);
47
65
  const stderrBuffer = new circular_buffer_1.CircularBuffer(opts.maxStderrBufferSize);
48
66
  let timer = null;
49
- // if the process errors out, reject the promise
50
- proc.on('error', /** @param {NodeJS.ErrnoException} err */ async (err) => {
51
- if (err.code === 'ENOENT') {
52
- err = await (0, helpers_1.formatEnoent)(err, cmd, opts.cwd?.toString());
67
+ proc.on('error', async (err) => {
68
+ let error = err;
69
+ if (error.code === 'ENOENT') {
70
+ error = await (0, helpers_1.formatEnoent)(error, cmd, opts.cwd?.toString());
53
71
  }
54
- reject(err);
72
+ reject(error);
55
73
  });
56
74
  if (proc.stdin) {
57
- proc.stdin.on('error', /** @param {NodeJS.ErrnoException} err */ (err) => {
75
+ proc.stdin.on('error', (err) => {
58
76
  reject(new Error(`Standard input '${err.syscall}' error: ${err.stack}`));
59
77
  });
60
78
  }
61
- const handleStream = (/** @type {string} */ streamType, /** @type {CircularBuffer} */ buffer) => {
62
- if (!proc[streamType]) {
79
+ const handleStream = (streamType, buffer) => {
80
+ const stream = proc[streamType];
81
+ if (!stream) {
63
82
  return;
64
83
  }
65
- proc[streamType].on('error', (err) => {
84
+ stream.on('error', (err) => {
66
85
  reject(new Error(`${lodash_1.default.capitalize(streamType)} '${err.syscall}' error: ${err.stack}`));
67
86
  });
68
87
  if (opts.ignoreOutput) {
69
88
  // https://github.com/nodejs/node/issues/4236
70
- proc[streamType].on('data', () => { });
89
+ stream.on('data', () => { });
71
90
  return;
72
91
  }
73
- // keep track of the stream if we don't want to ignore it
74
- proc[streamType].on('data', (/** @type {Buffer} */ chunk) => {
92
+ stream.on('data', (chunk) => {
75
93
  buffer.add(chunk);
76
- if (opts.logger && lodash_1.default.isFunction(opts.logger.debug)) {
94
+ if (opts.logger?.debug && lodash_1.default.isFunction(opts.logger.debug)) {
77
95
  opts.logger.debug(chunk.toString());
78
96
  }
79
97
  });
80
98
  };
81
99
  handleStream('stdout', stdoutBuffer);
82
100
  handleStream('stderr', stderrBuffer);
83
- /**
84
- * @template {boolean} U
85
- * @param {U} isBuffer
86
- * @returns {U extends true ? {stdout: Buffer, stderr: Buffer} : {stdout: string, stderr: string}}
87
- */
88
- function getStdio(isBuffer) {
89
- const stdout = isBuffer ? stdoutBuffer.value() : stdoutBuffer.value().toString(opts.encoding);
90
- const stderr = isBuffer ? stderrBuffer.value() : stderrBuffer.value().toString(opts.encoding);
91
- return /** @type {U extends true ? {stdout: Buffer, stderr: Buffer} : {stdout: string, stderr: string}} */ ({ stdout, stderr });
101
+ function getStdio(wantBuffer) {
102
+ const stdout = wantBuffer ? stdoutBuffer.value() : stdoutBuffer.value().toString(opts.encoding);
103
+ const stderr = wantBuffer ? stderrBuffer.value() : stderrBuffer.value().toString(opts.encoding);
104
+ return { stdout, stderr };
92
105
  }
93
- // if the process ends, either resolve or reject the promise based on the
94
- // exit code of the process. either way, attach stdout, stderr, and code.
95
- // Also clean up the timer if it exists
96
106
  proc.on('close', (code) => {
97
107
  if (timer) {
98
108
  clearTimeout(timer);
99
109
  }
100
110
  const { stdout, stderr } = getStdio(isBuffer);
101
111
  if (code === 0) {
102
- resolve(/** @type {BufferProp<T> extends true ? TeenProcessExecBufferResult : TeenProcessExecStringResult} */ ({ stdout, stderr, code }));
112
+ resolve({ stdout, stderr, code });
103
113
  }
104
114
  else {
105
- let err = new Error(`Command '${rep}' exited with code ${code}`);
106
- err = Object.assign(err, { stdout, stderr, code });
115
+ const err = Object.assign(new Error(`Command '${rep}' exited with code ${code}`), {
116
+ stdout,
117
+ stderr,
118
+ code,
119
+ });
107
120
  reject(err);
108
121
  }
109
122
  });
110
- // if we set a timeout on the child process, cut into the execution and
111
- // reject if the timeout is reached. Attach the stdout/stderr we currently
112
- // have in case it's helpful in debugging
113
123
  if (opts.timeout) {
114
124
  timer = setTimeout(() => {
115
125
  const { stdout, stderr } = getStdio(isBuffer);
116
- let err = new Error(`Command '${rep}' timed out after ${opts.timeout}ms`);
117
- err = Object.assign(err, { stdout, stderr, code: null });
126
+ const err = Object.assign(new Error(`Command '${rep}' timed out after ${opts.timeout}ms`), { stdout, stderr, code: null });
118
127
  reject(err);
119
- // reject and THEN kill to avoid race conditions with the handlers
120
- // above
121
- proc.kill(opts.killSignal);
128
+ proc.kill(opts.killSignal ?? 'SIGTERM');
122
129
  }, opts.timeout);
123
130
  }
124
131
  });
125
132
  }
126
- exports.default = exec;
127
- /**
128
- * Options on top of `SpawnOptions`, unique to `teen_process.`
129
- * @typedef {Object} TeenProcessProps
130
- * @property {boolean} [ignoreOutput] - Ignore & discard all output
131
- * @property {boolean} [isBuffer] - Return output as a Buffer
132
- * @property {TeenProcessLogger} [logger] - Logger to use for debugging
133
- * @property {number} [maxStdoutBufferSize] - Maximum size of `stdout` buffer
134
- * @property {number} [maxStderrBufferSize] - Maximum size of `stderr` buffer
135
- * @property {BufferEncoding} [encoding='utf8'] - Encoding to use for output
136
- */
137
- /**
138
- * A logger object understood by {@link exec teen_process.exec}.
139
- * @typedef {Object} TeenProcessLogger
140
- * @property {(...args: any[]) => void} debug
141
- */
142
- /**
143
- * Options for {@link exec teen_process.exec}.
144
- * @typedef {import('child_process').SpawnOptions & TeenProcessProps} TeenProcessExecOptions
145
- */
146
- /**
147
- * The value {@link exec teen_process.exec} resolves to when `isBuffer` is `false`
148
- * @typedef {Object} TeenProcessExecStringResult
149
- * @property {string} stdout - Stdout
150
- * @property {string} stderr - Stderr
151
- * @property {number?} code - Exit code
152
- */
153
- /**
154
- * The value {@link exec teen_process.exec} resolves to when `isBuffer` is `true`
155
- * @typedef {Object} TeenProcessExecBufferResult
156
- * @property {Buffer} stdout - Stdout
157
- * @property {Buffer} stderr - Stderr
158
- * @property {number?} code - Exit code
159
- */
160
- /**
161
- * Extra props {@link exec teen_process.exec} adds to its error objects
162
- * @typedef {Object} TeenProcessExecErrorProps
163
- * @property {string} stdout - STDOUT
164
- * @property {string} stderr - STDERR
165
- * @property {number?} code - Exit code
166
- */
167
- /**
168
- * Error thrown by {@link exec teen_process.exec}
169
- * @typedef {Error & TeenProcessExecErrorProps} TeenProcessExecError
170
- */
171
- /**
172
- * @template {{isBuffer?: boolean}} MaybeBuffer
173
- * @typedef {MaybeBuffer['isBuffer']} BufferProp
174
- * @private
175
- */
176
133
  //# sourceMappingURL=exec.js.map
@@ -1 +1 @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ive message, so it could be properly handled by a user.
4
- *
5
- * @param {NodeJS.ErrnoException} error Original error instance. !!! The instance is mutated after
6
- * this helper function invocation
7
- * @param {string} cmd Original command to execute
8
- * @param {string?} [cwd] Optional path to the current working dir
9
- * @returns {Promise<NodeJS.ErrnoException>} Mutated error instance with an improved description or an
10
- * unchanged error instance
11
- */
12
- export function formatEnoent(error: NodeJS.ErrnoException, cmd: string, cwd?: string | null): Promise<NodeJS.ErrnoException>;
1
+ export {};
13
2
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/helpers.js"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,oCAPW,MAAM,CAAC,cAAc,OAErB,MAAM,QACN,MAAM,OAAC,GACL,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAwB1C"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":""}
@@ -4,20 +4,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.formatEnoent = formatEnoent;
7
- const path_1 = __importDefault(require("path"));
8
- const promises_1 = __importDefault(require("fs/promises"));
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const promises_1 = __importDefault(require("node:fs/promises"));
9
9
  /**
10
- * Decorates ENOENT error received from a spawn system call
11
- * with a more descriptive message, so it could be properly handled by a user.
10
+ * Enhances ENOENT errors from spawn with descriptive messages.
12
11
  *
13
- * @param {NodeJS.ErrnoException} error Original error instance. !!! The instance is mutated after
14
- * this helper function invocation
15
- * @param {string} cmd Original command to execute
16
- * @param {string?} [cwd] Optional path to the current working dir
17
- * @returns {Promise<NodeJS.ErrnoException>} Mutated error instance with an improved description or an
18
- * unchanged error instance
12
+ * This is an internal helper that mutates the error object to provide context about:
13
+ * - Invalid working directory paths
14
+ * - Missing executables in PATH
15
+ *
16
+ * @param error - The original ENOENT error from spawn
17
+ * @param cmd - The command that was attempted to execute
18
+ * @param cwd - The working directory used (if any)
19
+ * @returns The same error object with an enhanced message
20
+ *
21
+ * @internal
19
22
  */
20
- async function formatEnoent(error, cmd, cwd = null) {
23
+ async function formatEnoent(error, cmd, cwd) {
21
24
  if (cwd) {
22
25
  try {
23
26
  const stat = await promises_1.default.stat(cwd);
@@ -27,13 +30,14 @@ async function formatEnoent(error, cmd, cwd = null) {
27
30
  }
28
31
  }
29
32
  catch (e) {
30
- if (e.code === 'ENOENT') {
33
+ const err = e;
34
+ if (err.code === 'ENOENT') {
31
35
  error.message = `The working directory '${cwd}' of '${cmd}' does not exist`;
32
36
  return error;
33
37
  }
34
38
  }
35
39
  }
36
- const curDir = path_1.default.resolve(cwd ?? process.cwd());
40
+ const curDir = node_path_1.default.resolve(cwd ?? process.cwd());
37
41
  const pathMsg = process.env.PATH ?? 'which is not defined for the process';
38
42
  error.message = `'${cmd}' executable is not found neither in the process working folder (${curDir}) ` +
39
43
  `nor in any folders specified in the PATH environment variable (${pathMsg})`;
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../lib/helpers.js"],"names":[],"mappings":";;;;;AAqCS,oCAAY;AArCrB,gDAAwB;AACxB,2DAA6B;AAE7B;;;;;;;;;;GAUG;AACH,KAAK,UAAU,YAAY,CAAE,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI;IACjD,IAAI,GAAG,EAAE,CAAC;QACR,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,kBAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,KAAK,CAAC,OAAO,GAAG,0BAA0B,GAAG,SAAS,GAAG,8BAA8B,CAAC;gBACxF,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAA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ED,MAAM,MAAM,GAAG,mBAAI,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,sCAAsC,CAAC;IAC3E,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,oEAAoE,MAAM,IAAI;QACnG,kEAAkE,OAAO,GAAG,CAAC;IAC/E,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,7 +1,5 @@
1
- export const exec: typeof execIndex.exec;
2
- export const spawn: typeof cp.spawn;
3
- export const SubProcess: typeof spIndex.SubProcess;
4
- import * as execIndex from './exec';
5
- import * as cp from 'child_process';
6
- import * as spIndex from './subprocess';
1
+ export { spawn } from 'node:child_process';
2
+ export { SubProcess } from './subprocess';
3
+ export { exec } from './exec';
4
+ export type { TeenProcessExecOptions, TeenProcessExecResult, SubProcessOptions } from './types';
7
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";;;2BAE2B,QAAQ;oBAFf,eAAe;yBACV,cAAc"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,SAAS,CAAC"}
@@ -1,46 +1,10 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.SubProcess = exports.spawn = exports.exec = void 0;
37
- const cp = __importStar(require("child_process"));
38
- const spIndex = __importStar(require("./subprocess"));
39
- const execIndex = __importStar(require("./exec"));
40
- const { spawn } = cp;
41
- exports.spawn = spawn;
42
- const { SubProcess } = spIndex;
43
- exports.SubProcess = SubProcess;
44
- const { exec } = execIndex;
45
- exports.exec = exec;
3
+ exports.exec = exports.SubProcess = exports.spawn = void 0;
4
+ var node_child_process_1 = require("node:child_process");
5
+ Object.defineProperty(exports, "spawn", { enumerable: true, get: function () { return node_child_process_1.spawn; } });
6
+ var subprocess_1 = require("./subprocess");
7
+ Object.defineProperty(exports, "SubProcess", { enumerable: true, get: function () { return subprocess_1.SubProcess; } });
8
+ var exec_1 = require("./exec");
9
+ Object.defineProperty(exports, "exec", { enumerable: true, get: function () { return exec_1.exec; } });
46
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAoC;AACpC,sDAAwC;AACxC,kDAAoC;AAEpC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AAIN,sBAAK;AAHpB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;AAGT,gCAAU;AAFhC,MAAM,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;AAElB,oBAAI"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";;;AAAA,yDAAyC;AAAjC,2GAAA,KAAK,OAAA;AACb,2CAAwC;AAAhC,wGAAA,UAAU,OAAA;AAClB,+BAA4B;AAApB,4FAAA,IAAI,OAAA"}