MCPcopy Create free account
hub / github.com/YGYOOO/WorldX / terminateProcess

Function terminateProcess

scripts/dev.mjs:81–98  ·  view source on GitHub ↗
(proc, signal)

Source from the content-addressed store, hash-verified

79}
80
81function terminateProcess(proc, signal) {
82 if (proc.exitCode != null) return;
83
84 try {
85 if (!IS_WINDOWS && proc.pid) {
86 process.kill(-proc.pid, signal);
87 return;
88 }
89 } catch {
90 // Fall through to direct child kill.
91 }
92
93 try {
94 proc.kill(signal);
95 } catch {
96 // Ignore already-exited children.
97 }
98}
99
100function sleep(ms) {
101 return new Promise((resolve) => setTimeout(resolve, ms));

Callers 1

shutdownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected