MCPcopy Index your code
hub / github.com/nodejs/node / execSync

Function execSync

lib/child_process.js:989–1004  ·  view source on GitHub ↗

* Spawns a shell executing the given `command` synchronously. * @param {string} command * @param {{ * cwd?: string | URL; * input?: string | Buffer | TypedArray | DataView; * stdio?: string | Array; * env?: Record ; * shell?: string; * uid?: number; * gid?: numb

(command, options)

Source from the content-addressed store, hash-verified

987 * @returns {Buffer | string}
988 */
989function execSync(command, options) {
990 const opts = normalizeExecArgs(command, options, null);
991 const inheritStderr = !opts.options.stdio;
992
993 const ret = spawnSync(opts.file, opts.options);
994
995 if (inheritStderr && ret.stderr)
996 process.stderr.write(ret.stderr);
997
998 const err = checkExecSyncError(ret, undefined, command);
999
1000 if (err)
1001 throw err;
1002
1003 return ret.stdout;
1004}
1005
1006
1007function validateArgumentNullCheck(arg, propName) {

Callers 15

checkFilesFunction · 0.85
childProcessExecStdoutFunction · 0.85
canCreateSymLinkFunction · 0.85
inFreeBSDJailFunction · 0.85
test-fs-rm.jsFile · 0.85
gitInitFunction · 0.85
makeDirectoryReadOnlyFunction · 0.85
makeDirectoryWritableFunction · 0.85
cleanupFunction · 0.85

Calls 4

normalizeExecArgsFunction · 0.85
checkExecSyncErrorFunction · 0.85
spawnSyncFunction · 0.70
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…