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

terminate

Package Overview
Dependencies
Maintainers
0
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.6.1 to 2.7.0

20

package.json
{
"name": "terminate",
"version": "2.6.1",
"version": "2.7.0",
"description": "Terminate a Node.js Process based on the Process ID",

@@ -13,2 +13,12 @@ "main": "terminate.js",

],
"exports": {
"./": {
"types": "./index.d.ts",
"default": "./terminate.js"
},
"./promise": {
"types": "./promise.d.ts",
"default": "./promise.js"
}
},
"scripts": {

@@ -42,8 +52,8 @@ "test": "nyc --report=lcov --report=text ./node_modules/tape/bin/tape ./test/*.js",

"devDependencies": {
"chalk": "^1.1.1",
"cli-color": "^2.0.3",
"goodparts": "1.3.0",
"jshint": "^2.9.6",
"nyc": "^15.1.0",
"pre-commit": "1.1.2",
"tape": "^4.4.0"
"nyc": "^17.0.0",
"pre-commit": "1.2.2",
"tape": "^5.7.3"
},

@@ -50,0 +60,0 @@ "pre-commit": [

var cp = require('child_process');
var chalk = require('chalk');
var red = chalk.red, green = chalk.green, cyan = chalk.cyan;
var clc = require("cli-color");
var red = clc.redBright, green = clc.greenBright, cyan = clc.cyanBright;
var count = 0;

@@ -5,0 +5,0 @@ function child() {

var test = require('tape');
var chalk = require('chalk');
var red = chalk.red, green = chalk.green, cyan = chalk.cyan;
var clc = require("cli-color");
var red = clc.redBright, green = clc.greenBright, cyan = clc.cyanBright;
var psTree = require('ps-tree'); // see: https://git.io/jBHZ

@@ -24,2 +24,3 @@ var exec = require('child_process').exec;

test(cyan('kills all processes'), function (t) {
t.plan(3);
var parent = exec("node " + require.resolve('./exec/parent.js'), function(error, stdout, stderr) {

@@ -46,3 +47,2 @@ if (error) {

t.equal(children.length, 0, green("✓ No more active child processes (we killed them)"));
t.end();
})

@@ -56,2 +56,3 @@ }, 200); // give psTree time to kill the processes

test(cyan('works with custom pollInterval'), function (t) {
t.plan(3);
var parent = exec("node " + require.resolve('./exec/parent.js'), function(error, stdout, stderr) {

@@ -77,3 +78,3 @@ if (error) {

t.equal(children.length, 0, green("✓ No more active child processes (we killed them)"));
t.end();
// t.end();
})

@@ -87,2 +88,3 @@ }, 200); // give psTree time to kill the processes

test(cyan('works when process takes awhile to exit'), function (t) {
t.plan(3);
var parent = exec(

@@ -112,3 +114,2 @@ "node " + require.resolve('./exec/parent.js'),

t.equal(children.length, 0, green("✓ No more active child processes (we killed them)"));
t.end();
})

@@ -150,2 +151,3 @@ }, 1500); // give psTree time to kill the processes

test(cyan('sends signal user passed'), function (t) {
t.plan(4);
var parent = exec("node " + require.resolve('./exec/parent.js'), function (error, stdout, stderr) {

@@ -171,3 +173,2 @@ t.assert(/^parent got SIGINT$/m.test(stdout), green("✓ parent reported getting SIGINT"));

t.equal(children.length, 0, green("✓ No more active child processes (we killed them)"));
t.end();
})

@@ -193,2 +194,3 @@ }, 200); // give psTree time to kill the processes

test(cyan('Terminate a process without providing a callback'), function (t) {
t.plan(1);
var child = exec("node " + require.resolve('./exec/parent.js'), function(error, stdout, stderr) { });

@@ -203,3 +205,2 @@ setTimeout(function(){

t.equal(children.length, 0, green("✓ No more active child processes"));
t.end();
});

@@ -206,0 +207,0 @@ },1000); // give psTree time to kill the processes

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