MCPcopy Create free account
hub / github.com/sindresorhus/execa / execaCoreAsync

Function execaCoreAsync

lib/methods/main-async.js:27–55  ·  view source on GitHub ↗
(rawFile, rawArguments, rawOptions, createNested)

Source from the content-addressed store, hash-verified

25
26// Main shared logic for all async methods: `execa()`, `$`, `execaNode()`
27export const execaCoreAsync = (rawFile, rawArguments, rawOptions, createNested) => {
28 const {file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors} = handleAsyncArguments(rawFile, rawArguments, rawOptions);
29 const {subprocess: nodeChildProcess, promise, kill, all, convertedStreams} = spawnSubprocessAsync({
30 file,
31 commandArguments,
32 options,
33 startTime,
34 verboseInfo,
35 command,
36 escapedCommand,
37 fileDescriptors,
38 });
39 const subprocess = getSubprocessPromise({
40 promise,
41 nodeChildProcess,
42 kill,
43 all,
44 convertedStreams,
45 options,
46 });
47 subprocess.pipe = pipeToSubprocess.bind(undefined, {
48 source: subprocess,
49 sourcePromise: promise,
50 boundOptions: {},
51 createNested,
52 });
53 SUBPROCESS_OPTIONS.set(subprocess, {options, fileDescriptors});
54 return subprocess;
55};
56
57// Compute arguments to pass to `child_process.spawn()`
58const handleAsyncArguments = (rawFile, rawArguments, rawOptions) => {

Callers 1

callBoundExecaFunction · 0.90

Calls 3

handleAsyncArgumentsFunction · 0.85
spawnSubprocessAsyncFunction · 0.85
getSubprocessPromiseFunction · 0.85

Tested by

no test coverage detected