(pid: number)
| 382 | // --------------------------------------------------------------------------- |
| 383 | |
| 384 | export const isPidAlive = (pid: number): boolean => { |
| 385 | if (!Number.isInteger(pid) || pid <= 0) return false; |
| 386 | try { |
| 387 | process.kill(pid, 0); |
| 388 | return true; |
| 389 | } catch { |
| 390 | return false; |
| 391 | } |
| 392 | }; |
| 393 | |
| 394 | export const terminatePid = (pid: number): Effect.Effect<void, Error> => |
| 395 | Effect.try({ |
no outgoing calls
no test coverage detected