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

Function signalHandler

lib/internal/main/watch_mode.js:206–212  ·  view source on GitHub ↗
(signal)

Source from the content-addressed store, hash-verified

204// parent process is killed.
205// this is fairly safe since user code cannot run in this process
206function signalHandler(signal) {
207 return async () => {
208 watcher.clear();
209 const exitCode = await killAndWait(signal, true);
210 process.exit(exitCode ?? kNoFailure);
211 };
212}
213
214process.on('SIGTERM', signalHandler('SIGTERM'));
215process.on('SIGINT', signalHandler('SIGINT'));

Callers 1

watch_mode.jsFile · 0.70

Calls 3

killAndWaitFunction · 0.85
clearMethod · 0.65
exitMethod · 0.45

Tested by

no test coverage detected