Comparing version 2.2.2 to 2.3.0
127
index.d.ts
declare module 'terminate' { | ||
interface TerminateOptions { | ||
/** | ||
* Interval to poll whether `pid` and all of the childs pids have been killed. | ||
* @default 500 | ||
*/ | ||
pollInterval?: number; | ||
/** | ||
* Max time (in milliseconds) to wait for process to exit before timing out | ||
* and calling back with an error. | ||
* @default 5000 | ||
*/ | ||
timeout?: number; | ||
} | ||
/** | ||
* Error-first callback called when everything is successfully done. | ||
*/ | ||
interface DoneCallback { | ||
/** | ||
* @param error - will be `null` if no error occured. | ||
*/ | ||
(error: Error | null): void; | ||
} | ||
/** | ||
* `terminate` is an ultra-simple way to kill all the node processes | ||
* by providing a process pid. It finds all child processes and shuts | ||
* them down too, so you don't have to worry about lingering processes. | ||
* | ||
* @param pid - the Process ID you want to terminate. | ||
*/ | ||
export default function terminate(pid: number): void; | ||
/** | ||
* `terminate` is an ultra-simple way to kill all the node processes | ||
* by providing a process pid. It finds all child processes and shuts | ||
* them down too, so you don't have to worry about lingering processes. | ||
* | ||
* @param pid - the Process ID you want to terminate. | ||
* @param signal - the signal to kill the processes with. Defaults to `"SIGKILL"` | ||
* if it's empty or not defined. | ||
*/ | ||
export default function terminate(pid: number, signal: string): void; | ||
/** | ||
* `terminate` is an ultra-simple way to kill all the node processes | ||
* by providing a process pid. It finds all child processes and shuts | ||
* them down too, so you don't have to worry about lingering processes. | ||
* | ||
* @param pid - the Process ID you want to terminate. | ||
* @param signal - the signal to kill the processes with. Defaults to `"SIGKILL"` | ||
* if it's empty or not defined. | ||
* @param opts - options to object. | ||
*/ | ||
export default function terminate(pid: number, signal: string, opts: TerminateOptions): void; | ||
/** | ||
* `terminate` is an ultra-simple way to kill all the node processes | ||
* by providing a process pid. It finds all child processes and shuts | ||
* them down too, so you don't have to worry about lingering processes. | ||
* | ||
* @param pid - the Process ID you want to terminate. | ||
* @param signal - the signal to kill the processes with. Defaults to `"SIGKILL"` | ||
* if it's empty or not defined. | ||
* @param opts - options to object. | ||
* @param callback - if you want to know once the procesess have been terminated, | ||
* supply a callback. | ||
*/ | ||
export default function terminate(pid: number, signal?: string, opts?: TerminateOptions, callback?: DoneCallback): void; | ||
/** | ||
* `terminate` is an ultra-simple way to kill all the node processes | ||
* by providing a process pid. It finds all child processes and shuts | ||
* them down too, so you don't have to worry about lingering processes. | ||
* | ||
* @param pid - the Process ID you want to terminate. | ||
* @param signal - the signal to kill the processes with. Defaults to `"SIGKILL"` | ||
* if it's empty or not defined. | ||
* @param callback - if you want to know once the procesess have been terminated, | ||
* supply a callback. | ||
*/ | ||
export default function terminate(pid: number, signal: string, callback: DoneCallback): void; | ||
/** | ||
* `terminate` is an ultra-simple way to kill all the node processes | ||
* by providing a process pid. It finds all child processes and shuts | ||
* them down too, so you don't have to worry about lingering processes. | ||
* | ||
* @param pid - the Process ID you want to terminate. | ||
* @param signal - the signal to kill the processes with. Defaults to `"SIGKILL"` | ||
* if it's empty or not defined. | ||
* @param opts - options to object. | ||
* @param callback - if you want to know once the procesess have been terminated, | ||
* supply a callback. | ||
*/ | ||
export default function terminate(pid: number, signal: string, opts: TerminateOptions, callback: DoneCallback): void; | ||
/** | ||
* `terminate` is an ultra-simple way to kill all the node processes | ||
* by providing a process pid. It finds all child processes and shuts | ||
* them down too, so you don't have to worry about lingering processes. | ||
* | ||
* @param pid - the Process ID you want to terminate. | ||
* @param opts - options to object. | ||
*/ | ||
export default function terminate(pid: number, opts: TerminateOptions): void; | ||
/** | ||
* `terminate` is an ultra-simple way to kill all the node processes | ||
* by providing a process pid. It finds all child processes and shuts | ||
* them down too, so you don't have to worry about lingering processes. | ||
* | ||
* @param pid - the Process ID you want to terminate. | ||
* @param callback - if you want to know once the procesess have been terminated, | ||
* supply a callback. | ||
*/ | ||
export default function terminate(pid: number, opts: TerminateOptions, callback: DoneCallback): void; | ||
/** | ||
* `terminate` is an ultra-simple way to kill all the node processes | ||
* by providing a process pid. It finds all child processes and shuts | ||
* them down too, so you don't have to worry about lingering processes. | ||
* | ||
* @param pid - the Process ID you want to terminate. | ||
* @param callback - if you want to know once the procesess have been terminated, | ||
* supply a callback. | ||
*/ | ||
export default function terminate(pid: number, callback: DoneCallback): void; | ||
} |
{ | ||
"name": "terminate", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"description": "Terminate a Node.js Process based on the Process ID", | ||
"main": "terminate.js", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"test/**", | ||
"*.js", | ||
"*.ts", | ||
"*.json" | ||
], | ||
"scripts": { | ||
@@ -7,0 +14,0 @@ "test": "istanbul cover --report lcov --report text ./node_modules/tape/bin/tape ./test/*.js", |
@@ -21,2 +21,3 @@ # terminate | ||
```sh | ||
## Using NPM | ||
npm install terminate --save | ||
@@ -28,3 +29,4 @@ ``` | ||
```js | ||
var terminate = require('terminate'); | ||
const terminate = require('terminate'); | ||
terminate(process.pid, function (err) { | ||
@@ -40,4 +42,8 @@ if (err) { // you will get an error if you did not supply a valid process.pid | ||
<br /> | ||
#### Usage | ||
All the available parameters and their descriptions are viewable in the TypeScript definition file: [**`index.d.ts`**](./index.d.ts#L71). | ||
<br /> | ||
# tl;dr | ||
@@ -44,0 +50,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
129572
3145
150
10
3