Comparing version 2.1.0 to 2.1.2
{ | ||
"name": "terminate", | ||
"version": "2.1.0", | ||
"version": "2.1.2", | ||
"description": "Terminate a Node.js Process based on the Process ID", | ||
@@ -9,3 +9,4 @@ "main": "terminate.js", | ||
"coverage": "npm test && istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", | ||
"jshint": "./node_modules/jshint/bin/jshint -c .jshintrc --exclude-path .gitignore ." | ||
"jshint": "./node_modules/jshint/bin/jshint -c .jshintrc --exclude-path .gitignore .", | ||
"lint": "node_modules/.bin/goodparts terminate.js" | ||
}, | ||
@@ -30,6 +31,7 @@ "repository": { | ||
"dependencies": { | ||
"ps-tree": "^1.1.0" | ||
"ps-tree": "^1.1.1" | ||
}, | ||
"devDependencies": { | ||
"chalk": "^1.1.1", | ||
"goodparts": "1.2.1", | ||
"istanbul": "^0.4.5", | ||
@@ -36,0 +38,0 @@ "jshint": "^2.9.1", |
@@ -13,2 +13,3 @@ # terminate | ||
[![Dependency Status](https://david-dm.org/dwyl/terminate.svg)](https://david-dm.org/dwyl/terminate) | ||
[![JavaScript Style Guide: Good Parts](https://img.shields.io/badge/code%20style-goodparts-brightgreen.svg?style=flat)](https://github.com/dwyl/goodparts "JavaScript The Good Parts") | ||
@@ -15,0 +16,0 @@ |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var psTree = require('ps-tree'); // see: http://git.io/jBHZ | ||
@@ -9,16 +11,20 @@ var handlePsTreeCallback = require('./handlePsTreeCallback'); | ||
* @param {int} pid - the Process ID you want to terminate | ||
* @param {string=SIGTERM} signal (optional) - the signal to kill the processes | ||
* @param {string} [signal=SIGTERM] - the signal to kill the processes | ||
* with. | ||
* @param {object={}} options | ||
* @param {number=500} options.pollInterval - interval to poll whether pid | ||
* @param {object} [options={}] - options object | ||
* @param {number} [options.pollInterval=500] - interval to poll whether pid | ||
* and all of the child pids have been killed. | ||
* @param {number=5000} options.timeout - max time to wait for processes to | ||
* @param {number} [options.timeout=5000] - max time to wait for processes to | ||
* exit before timing out and calling back with an error. | ||
* @param {function=} callback (optional) - if you want to know once the | ||
* @param {function=} callback - if you want to know once the | ||
* procesess have been terminated, supply a callback. | ||
* @param {Error} error - will be null if no error occured | ||
* @param {Error} error - will be null if no error occured | ||
* @returns {void} | ||
*/ | ||
module.exports = function terminate(pid) { | ||
if(!pid) { | ||
throw new Error("No pid supplied to Terminate!") | ||
module.exports = function terminate (pid) { | ||
var i = 1; | ||
var signal, options, callback; | ||
if (!pid) { | ||
throw new Error('No pid supplied to Terminate!'); | ||
} | ||
@@ -28,4 +34,2 @@ | ||
// ones present have to be in the | ||
var i = 1; | ||
var signal, options, callback; | ||
if (typeof arguments[i] === 'string') { | ||
@@ -32,0 +36,0 @@ signal = arguments[i++]; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
356
145
2
22058
6
10
Updatedps-tree@^1.1.1