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

Function customPromiseExecFunction

lib/child_process.js:241–257  ·  view source on GitHub ↗
(orig)

Source from the content-addressed store, hash-verified

239}
240
241const customPromiseExecFunction = (orig) => {
242 return assignFunctionName(orig.name, function(...args) {
243 const { promise, resolve, reject } = PromiseWithResolvers();
244
245 promise.child = orig(...args, (err, stdout, stderr) => {
246 if (err !== null) {
247 err.stdout = stdout;
248 err.stderr = stderr;
249 reject(err);
250 } else {
251 resolve({ stdout, stderr });
252 }
253 });
254
255 return promise;
256 });
257};
258
259ObjectDefineProperty(exec, promisify.custom, {
260 __proto__: null,

Callers 1

child_process.jsFile · 0.85

Calls 3

assignFunctionNameFunction · 0.85
resolveFunction · 0.70
rejectFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…