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.4.0 to 2.5.0

promise.d.ts

8

index.d.ts

@@ -55,3 +55,3 @@ declare module 'terminate' {

* if it's empty or not defined.
* @param opts - options to object.
* @param opts - options object.
*/

@@ -68,3 +68,3 @@ export default function terminate(pid: number, signal: string, opts: TerminateOptions): void;

* if it's empty or not defined.
* @param opts - options to object.
* @param opts - options object.
* @param callback - if you want to know once the procesess have been terminated,

@@ -95,3 +95,3 @@ * supply a callback.

* if it's empty or not defined.
* @param opts - options to object.
* @param opts - options object.
* @param callback - if you want to know once the procesess have been terminated,

@@ -108,3 +108,3 @@ * supply a callback.

* @param pid - the Process ID you want to terminate.
* @param opts - options to object.
* @param opts - options object.
*/

@@ -111,0 +111,0 @@ export default function terminate(pid: number, opts: TerminateOptions): void;

{
"name": "terminate",
"version": "2.4.0",
"version": "2.5.0",
"description": "Terminate a Node.js Process based on the Process ID",

@@ -5,0 +5,0 @@ "main": "terminate.js",

@@ -32,6 +32,7 @@ # terminate

if (err) { // you will get an error if you did not supply a valid process.pid
console.log("Oopsy: " + err); // handle errors in your preferred way.
console.log('Oopsy:', err); // handle errors in your preferred way.
}
else {
console.log('done'); // terminating the Processes succeeded.
// NOTE: The above won't be run in this example as the process itself will be killed before.
}

@@ -45,2 +46,19 @@ });

#### Promise API
If you are **using Node.js 8+**, you can load the Promise version importing the module `terminate/promise.js` like this:
```js
const terminate = require('terminate/promise');
(async () => {
try {
await terminate(process.pid);
console.log('done');
} catch (err) {
console.log('Oopsy:', err);
}
})();
```
<br />

@@ -47,0 +65,0 @@

Sorry, the diff of this file is too big to display

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