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

Function restart

lib/internal/main/watch_mode.js:172–186  ·  view source on GitHub ↗
(child, trigger)

Source from the content-addressed store, hash-verified

170let restarting = false;
171
172async function restart(child, trigger) {
173 if (restarting) return;
174 restarting = true;
175 try {
176 if (!kPreserveOutput) process.stdout.write(clear);
177 if (trigger) {
178 process.stdout.write(`${blue}Change detected in ${inspect(trigger)}${white}\n`);
179 }
180 process.stdout.write(`${green}Restarting ${kCommandStr}${white}\n`);
181 await stop(child);
182 return start();
183 } finally {
184 restarting = false;
185 }
186}
187
188async function init() {
189 let child = start();

Callers 1

restartChildFunction · 0.70

Calls 4

stopFunction · 0.70
startFunction · 0.70
inspectFunction · 0.50
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…