tunli 0.0.19 → 0.0.20
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/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {stdout} from 'node:process';
|
|
1
|
+
import {argv, stdout} from 'node:process';
|
|
2
2
|
import EventEmitter from "node:events";
|
|
3
3
|
import {spawn} from "child_process";
|
|
4
4
|
|
|
@@ -18,9 +18,10 @@ export const clearTerminal = () => {
|
|
|
18
18
|
/**
|
|
19
19
|
* Runs a child process and proxies its output.
|
|
20
20
|
* @param {string} pathToExecutable - Relative or absolute path to the executable script
|
|
21
|
+
* @param {array} [proxyArguments=process.argv.slice(2)] - Arguments to pass to the child process (default: process arguments)
|
|
21
22
|
* @returns {Promise<number|null>} - Exit code of the child process
|
|
22
23
|
*/
|
|
23
|
-
export const proxyChildProcess = (pathToExecutable) => {
|
|
24
|
+
export const proxyChildProcess = (pathToExecutable, proxyArguments = argv.slice(2)) => {
|
|
24
25
|
|
|
25
26
|
const eventEmitter = new EventEmitter()
|
|
26
27
|
const createSpawnProcessPromise = () => {
|
|
@@ -45,7 +46,7 @@ export const proxyChildProcess = (pathToExecutable) => {
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
const child = spawn('node', [pathToExecutable], {
|
|
49
|
+
const child = spawn('node', [pathToExecutable, ...proxyArguments], {
|
|
49
50
|
stdio: ['inherit', 'inherit', 'inherit', 'ipc'] // Proxy standard output and error to the main process, enable IPC channel
|
|
50
51
|
})
|
|
51
52
|
.on('close', onClose)
|