1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| process.stdin.resume();
process.on("beforeExit", (code) => { console.log("Process beforeExit event with code: ", code); });
process.on("exit", (code) => { console.log("Process exit event with code: ", code); });
process.on("SIGINT", (signal) => { console.log(`Process ${process.pid} has been interrupted`); process.exit(0); });
process.on('SIGUSR1', (signal) => { console.log(`Process ${process.pid} received a SIGUSR1 signal`); });
process.on('SIGHUP', (signal) => { console.log(`Process ${process.pid} received a SIGHUP signal`); });
process.on('SIGWINCH', (signal) => { console.log(`Process ${process.pid} received a SIGWINCH signal`); });
process.on('SIGKILL', (signal) => { console.log(`Process ${process.pid} received a SIGKILL signal`); });
process.on("uncaughtException", (err) => { console.log(`Uncaught Exception: ${err.message}`); process.exit(1); });
|