Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
The fkill npm package is a utility for forcefully killing processes. It provides a simple and user-friendly way to terminate processes by their name, port, or PID (Process ID).
Kill a process by name
This feature allows you to kill a process by specifying its name. In this example, the 'chrome' process is terminated.
const fkill = require('fkill');
fkill('chrome').then(() => {
console.log('Chrome has been killed');
});
Kill a process by PID
This feature allows you to kill a process by specifying its PID. In this example, the process with PID 1337 is terminated.
const fkill = require('fkill');
fkill(1337).then(() => {
console.log('Process with PID 1337 has been killed');
});
Kill a process by port
This feature allows you to kill a process by specifying the port it is using. In this example, the process running on port 8080 is terminated.
const fkill = require('fkill');
fkill(':8080').then(() => {
console.log('Process running on port 8080 has been killed');
});
Force kill a process
This feature allows you to forcefully kill a process. In this example, the 'node' process is forcefully terminated.
const fkill = require('fkill');
fkill('node', {force: true}).then(() => {
console.log('Node process has been forcefully killed');
});
The taskkill package provides similar functionality to fkill, allowing you to kill processes by name or PID. It is more Windows-centric and uses the Windows taskkill command under the hood.
The ps-node package allows you to search for and kill processes by name or PID. It provides more detailed process information and is cross-platform, but it requires more configuration compared to fkill.
The kill-port package is focused on killing processes by port. It is simpler and more specialized compared to fkill, which offers a broader range of process-killing options.
Fabulously kill processes. Cross-platform.
Works on macOS (10.13 or later), Linux, Windows.
npm install fkill
import fkill from 'fkill';
await fkill(1337);
console.log('Killed process');
fkill('Safari');
fkill(':8080');
fkill([1337, 'Safari', ':8080']);
Returns a promise that resolves when the processes are killed.
Type: number | string | Array<number | string>
One or more process IDs/names/ports to kill.
To kill a port, prefix it with a colon. For example: :8080
.
Type: object
Type: boolean
Default: false
Force kill the processes.
Type: number
Default: undefined
Force kill processes that did not exit within the given number of milliseconds.
Type: boolean
Default: true
Kill all child processes along with the parent process. (Windows only)
Type: boolean
Default: false
Ignore capitalization when killing a process.
Note that the case is always ignored on Windows.
Type: boolean
Default: false
Suppress all error messages. For example: Process doesn't exist
.
FAQs
Fabulously kill processes. Cross-platform.
We found that fkill demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.