Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/fkill
Fabulously kill processes. Cross-platform.
https://github.com/sindresorhus/fkill
Last synced: 4 days ago
JSON representation
Fabulously kill processes. Cross-platform.
- Host: GitHub
- URL: https://github.com/sindresorhus/fkill
- Owner: sindresorhus
- License: mit
- Created: 2015-06-20T20:30:33.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-11-07T09:21:06.000Z (about 1 year ago)
- Last Synced: 2024-10-29T15:46:40.407Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 116 KB
- Stars: 728
- Watchers: 11
- Forks: 34
- Open Issues: 7
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-cross-platform-nodejs - fkill - Kill processes. Cross-platform. (Libraries / Signals)
- awesome-tools - **fkill**
- awesome - sindresorhus/fkill - Fabulously kill processes. Cross-platform. (JavaScript)
README
> Fabulously kill processes. Cross-platform.
Works on macOS (10.13 or later), Linux, Windows.
## Install
```sh
npm install fkill
```## Usage
```js
import fkill from 'fkill';await fkill(1337);
console.log('Killed process');fkill('Safari');
fkill(':8080');fkill([1337, 'Safari', ':8080']);
```## API
### fkill(input, options?)
Returns a promise that resolves when the processes are killed.
#### input
Type: `number | string | Array`
One or more process IDs/names/ports to kill.
To kill a port, prefix it with a colon. For example: `:8080`.
#### options
Type: `object`
##### force
Type: `boolean`\
Default: `false`Force kill the processes.
##### forceAfterTimeout
Type: `number`\
Default: `undefined`Force kill processes that did not exit within the given number of milliseconds.
##### tree
Type: `boolean`\
Default: `true`Kill all child processes along with the parent process. *(Windows only)*
##### ignoreCase
Type: `boolean`\
Default: `false`Ignore capitalization when killing a process.
Note that the case is always ignored on Windows.
##### silent
Type: `boolean`\
Default: `false`Suppress all error messages. For example: `Process doesn't exist`.
## Related
- [fkill-cli](https://github.com/sindresorhus/fkill-cli) - CLI for this module
- [alfred-fkill](https://github.com/SamVerschueren/alfred-fkill) - Alfred workflow for this module