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

fkill

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fkill - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

38

index.js

@@ -7,3 +7,3 @@ 'use strict';

function win(input, opts) {
function winKill(input, opts) {
return taskkill(input, {

@@ -15,4 +15,5 @@ force: opts.force,

function def(input, opts) {
const cmd = typeof input === 'string' ? 'killall' : 'kill';
function macOSKill(input, opts) {
const killByName = typeof input === 'string';
const cmd = killByName ? 'pkill' : 'kill';
const args = [input];

@@ -24,11 +25,38 @@

if (killByName && opts.ignoreCase) {
args.unshift('-i');
}
return execa(cmd, args);
}
function defaultKill(input, opts) {
const killByName = typeof input === 'string';
const cmd = killByName ? 'killall' : 'kill';
const args = [input];
if (opts.force) {
args.unshift('-9');
}
if (killByName && opts.ignoreCase) {
args.unshift('-I');
}
return execa(cmd, args);
}
module.exports = (input, opts) => {
opts = opts || {};
const fn = process.platform === 'win32' ? win : def;
const errors = [];
let fn;
if (process.platform === 'darwin') {
fn = macOSKill;
} else if (process.platform === 'win32') {
fn = winKill;
} else {
fn = defaultKill;
}
// Don't kill ourselves

@@ -35,0 +63,0 @@ input = arrify(input).filter(x => x !== process.pid);

2

package.json
{
"name": "fkill",
"version": "5.1.0",
"version": "5.2.0",
"description": "Fabulously kill processes. Cross-platform.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -46,3 +46,3 @@ <h1 align="center">

Type: `number` `string` `Array<number|string>`
Type: `number` `string` `number[]` `string[]`

@@ -67,3 +67,12 @@ One or more process IDs/names to kill.

##### ignoreCase
Type: `boolean`<br>
Default: `false`
Ignore capitalization when killing a process.
Note that the case is always ignored on Windows.
## Related

@@ -70,0 +79,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