MCPcopy Create free account
hub / github.com/react/create-react-app / executeNodeScript

Function executeNodeScript

packages/create-react-app/createReactApp.js:1077–1095  ·  view source on GitHub ↗
({ cwd, args }, data, source)

Source from the content-addressed store, hash-verified

1075}
1076
1077function executeNodeScript({ cwd, args }, data, source) {
1078 return new Promise((resolve, reject) => {
1079 const child = spawn(
1080 process.execPath,
1081 [...args, '-e', source, '--', JSON.stringify(data)],
1082 { cwd, stdio: 'inherit' }
1083 );
1084
1085 child.on('close', code => {
1086 if (code !== 0) {
1087 reject({
1088 command: `node ${args.join(' ')}`,
1089 });
1090 return;
1091 }
1092 resolve();
1093 });
1094 });
1095}
1096
1097function checkForLatestVersion() {
1098 return new Promise((resolve, reject) => {

Callers 1

runFunction · 0.70

Calls 2

rejectFunction · 0.50
resolveFunction · 0.50

Tested by

no test coverage detected