MCPcopy Create free account
hub / github.com/nodejs/node / spawn

Function spawn

test/fixtures/snapshot/child-process-sync.js:8–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6} = require('v8').startupSnapshot;
7
8function spawn() {
9 const { spawnSync, execFileSync, execSync } = require('child_process');
10 spawnSync(process.execPath, [ __filename, 'spawnSync' ], { stdio: 'inherit' });
11 if (!process.env.DIRNAME_CONTAINS_SHELL_UNSAFE_CHARS)
12 execSync(`"${process.execPath}" "${__filename}" "execSync"`, { stdio: 'inherit' });
13 execFileSync(process.execPath, [ __filename, 'execFileSync' ], { stdio: 'inherit' });
14}
15
16if (process.argv[2] !== undefined) {
17 console.log('From child process', process.argv[2]);

Calls 4

execSyncFunction · 0.85
execFileSyncFunction · 0.85
requireFunction · 0.50
spawnSyncFunction · 0.50

Tested by

no test coverage detected