kill-sync
Version:
Cross-platform kill command. Supports recusive/tree-kill in a synchronous manner.
22 lines (21 loc) • 892 B
TypeScript
/**
* Code below is inspired by tree-kill-sync and tree-kill:
* - https://github.com/dvpnt/tree-kill-sync/blob/master/index.js
* - https://github.com/pkrumins/node-tree-kill/blob/master/index.js
*/
/**
* Kills a process with the specified PID using the given signal.
* The error ESRCH will be ignored.
*
* @param {number} pid - The PID of the process to be killed.
* @param {number | string} signal - The signal to send for termination.
*/
export declare const killPid: (pid: number, signal: number | string) => void;
/**
* Recursively kills a process and all its child processes using the specified
* signal - i.e. terminates the whole process tree.
*
* @param {number} pid - process pid to be killed alongside children.
* @param {number | string} signal - the signal to send for termination.
*/
export declare const treeKill: (pid: number, signal: string | number) => void;