kill-me-now 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/index.mjs +4 -9
- package/package.json +5 -3
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Kill Me Now
|
|
2
|
+
|
|
3
|
+
Find and kill application processes
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i -P kill-me-now
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
- A `filePath` is to identify application processes is _required_
|
|
12
|
+
- A `process` ID to *exclude* is _optional_
|
|
13
|
+
- A `command` is _optional_
|
package/index.mjs
CHANGED
|
@@ -148,17 +148,12 @@ function forEach ({ PROCESS }) {
|
|
|
148
148
|
*/
|
|
149
149
|
export default async function killMeNow (filePath, process, command) {
|
|
150
150
|
const lsof = await getLsofArray()
|
|
151
|
-
const hasOpenFiles = getHasOpenFiles(filePath)
|
|
152
|
-
|
|
153
|
-
if (lsof.some(hasOpenFiles)) {
|
|
154
|
-
const forFilePath = getFilterForFilePath(filePath)
|
|
155
|
-
const forProcess = getFilterForProcess(process)
|
|
156
|
-
const forCommand = getFilterForCommand(command)
|
|
157
151
|
|
|
152
|
+
if (lsof.some(getHasOpenFiles(filePath))) {
|
|
158
153
|
lsof.flat()
|
|
159
|
-
.filter(
|
|
160
|
-
.filter(
|
|
161
|
-
.filter(
|
|
154
|
+
.filter(getFilterForFilePath(filePath))
|
|
155
|
+
.filter(getFilterForProcess(process))
|
|
156
|
+
.filter(getFilterForCommand(command))
|
|
162
157
|
.forEach(forEach)
|
|
163
158
|
}
|
|
164
159
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kill-me-now",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"main": "./index.mjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -15,14 +15,16 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"lint": "eslint .",
|
|
18
|
-
"lint:fix": "npm run lint -- --fix"
|
|
18
|
+
"lint:fix": "npm run lint -- --fix",
|
|
19
|
+
"prepare": "husky"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"@sequencemedia/eslint-config-standard": "^0.2.52",
|
|
22
23
|
"@sequencemedia/eslint-config-typescript": "^0.1.82",
|
|
23
24
|
"@types/node": "^22.15.3",
|
|
24
25
|
"eslint": "^9.26.0",
|
|
25
|
-
"globals": "^16.0.0"
|
|
26
|
+
"globals": "^16.0.0",
|
|
27
|
+
"husky": "^9.1.7"
|
|
26
28
|
},
|
|
27
29
|
"dependencies": {
|
|
28
30
|
"@sequencemedia/lsof": "^0.0.2"
|