Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

terminate

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terminate - npm Package Compare versions

Comparing version 2.2.2 to 2.3.0

package-lock.json

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;
}

9

package.json
{
"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",

10

README.md

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc