import { Deno } from "https://deno.land/x/deno@v1.0.0/cli/js/lib.deno.unstable.d.ts";
const { kill } = Deno;
UNSTABLE: The signo
argument may change to require the Deno.Signal
enum.
Send a signal to process under given pid
. This functionality currently
only works on Linux and Mac OS.
If pid
is negative, the signal will be sent to the process group
identified by pid
.
const p = Deno.run({
cmd: ["python", "-c", "from time import sleep; sleep(10000)"]
});
Deno.kill(p.pid, Deno.Signal.SIGINT);
Throws Error (not yet implemented) on Windows
Requires allow-run
permission.