MCPcopy Create free account
hub / github.com/axios/axios / runModuleInChildProcess

Function runModuleInChildProcess

tests/setup/runModuleInChildProcess.js:3–19  ·  view source on GitHub ↗
(source, options)

Source from the content-addressed store, hash-verified

1import { execFile } from 'child_process';
2
3export function runModuleInChildProcess(source, options) {
4 return new Promise(function (resolve, reject) {
5 execFile(
6 process.execPath,
7 ['--input-type=module', '-e', source],
8 Object.assign({ timeout: 3000, killSignal: 'SIGKILL' }, options),
9 function (error, stdout, stderr) {
10 if (error) {
11 error.stdout = stdout;
12 error.stderr = stderr;
13 return reject(error);
14 }
15 resolve(stdout);
16 }
17 );
18 });
19}

Calls

no outgoing calls

Tested by

no test coverage detected