@webpod/ps 1.0.0 → 1.1.0
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/package.json +12 -13
- package/target/cjs/index.cjs +3 -7
- package/target/esm/index.mjs +3 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpod/ps",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A process lookup utility",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"build:dts": "tsc --emitDeclarationOnly --outDir target/dts",
|
|
24
24
|
"build:docs": "typedoc --options src/main/typedoc",
|
|
25
25
|
"build:stamp": "npx buildstamp",
|
|
26
|
-
"test": "concurrently 'npm:test
|
|
27
|
-
"test:lint": "
|
|
26
|
+
"test": "concurrently 'npm:test:lint' 'npm:test:unit' && npm run test:legacy",
|
|
27
|
+
"test:lint": "oxlint -c oxlintrc.json src/main/ts src/test/ts",
|
|
28
28
|
"test:unit": "c8 -r lcov -r text -o target/coverage -x src/scripts -x src/test -x target node --loader ts-node/esm --experimental-specifier-resolution=node src/scripts/test.mjs",
|
|
29
|
-
"
|
|
29
|
+
"test:legacy": "node ./node_modules/mocha/bin/mocha -t 0 -R spec src/test/legacy/test.cjs",
|
|
30
30
|
"publish:draft": "npm run build && npm publish --no-git-tag-version"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
@@ -42,23 +42,22 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@webpod/ingrid": "^1.1.1",
|
|
45
|
-
"zurk": "^0.11.
|
|
45
|
+
"zurk": "^0.11.10"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@types/node": "^
|
|
49
|
-
"c8": "^
|
|
48
|
+
"@types/node": "^25.5.2",
|
|
49
|
+
"c8": "^11.0.0",
|
|
50
50
|
"concurrently": "^9.2.1",
|
|
51
|
-
"esbuild": "^0.
|
|
52
|
-
"esbuild-node-externals": "^1.
|
|
53
|
-
"esbuild-plugin-entry-chunks": "^0.1.
|
|
54
|
-
"
|
|
55
|
-
"eslint-config-qiwi": "^2.1.3",
|
|
51
|
+
"esbuild": "^0.28.0",
|
|
52
|
+
"esbuild-node-externals": "^1.21.0",
|
|
53
|
+
"esbuild-plugin-entry-chunks": "^0.1.18",
|
|
54
|
+
"oxlint": "^1.58.0",
|
|
56
55
|
"fast-glob": "^3.3.3",
|
|
57
56
|
"minimist": "^1.2.8",
|
|
58
57
|
"mocha": "^10.8.2",
|
|
59
58
|
"sinon": "^18.0.1",
|
|
60
59
|
"ts-node": "^10.9.2",
|
|
61
|
-
"typedoc": "^0.28.
|
|
60
|
+
"typedoc": "^0.28.18",
|
|
62
61
|
"typescript": "^5.9.2"
|
|
63
62
|
},
|
|
64
63
|
"repository": {
|
package/target/cjs/index.cjs
CHANGED
|
@@ -77,7 +77,7 @@ var LOOKUPS = {
|
|
|
77
77
|
},
|
|
78
78
|
ps: {
|
|
79
79
|
cmd: "ps",
|
|
80
|
-
args: ["-
|
|
80
|
+
args: ["-eo", "pid,ppid,args"],
|
|
81
81
|
parse(stdout) {
|
|
82
82
|
return (0, import_ingrid.parse)(stdout, { format: "unix" });
|
|
83
83
|
}
|
|
@@ -125,11 +125,7 @@ var _lookup = ({
|
|
|
125
125
|
const { promise, resolve, reject } = pFactory();
|
|
126
126
|
const result = [];
|
|
127
127
|
const lookupFlow = IS_WIN ? IS_WIN2025_PLUS ? "pwsh" : "wmic" : "ps";
|
|
128
|
-
const {
|
|
129
|
-
parse: parse2,
|
|
130
|
-
cmd,
|
|
131
|
-
args
|
|
132
|
-
} = LOOKUPS[lookupFlow];
|
|
128
|
+
const { parse: parse2, cmd, args } = LOOKUPS[lookupFlow];
|
|
133
129
|
const callback = (err, { stdout }) => {
|
|
134
130
|
if (err) {
|
|
135
131
|
reject(err);
|
|
@@ -263,7 +259,7 @@ var normalizeOutput = (data) => data.reduce((m, d) => {
|
|
|
263
259
|
var _a, _b;
|
|
264
260
|
const pid = (_a = d.PID || d.ProcessId) == null ? void 0 : _a[0];
|
|
265
261
|
const ppid = (_b = d.PPID || d.ParentProcessId) == null ? void 0 : _b[0];
|
|
266
|
-
const _cmd = d.CMD || d.CommandLine || d.COMMAND || [];
|
|
262
|
+
const _cmd = d.CMD || d.CommandLine || d.COMMAND || d.ARGS || [];
|
|
267
263
|
const cmd = _cmd.length === 1 ? _cmd[0].split(/\s+/) : _cmd;
|
|
268
264
|
if (pid && cmd.length > 0) {
|
|
269
265
|
const c = cmd.findIndex((_v, i) => isBin(cmd.slice(0, i).join(" ")));
|
package/target/esm/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ var LOOKUPS = {
|
|
|
16
16
|
},
|
|
17
17
|
ps: {
|
|
18
18
|
cmd: "ps",
|
|
19
|
-
args: ["-
|
|
19
|
+
args: ["-eo", "pid,ppid,args"],
|
|
20
20
|
parse(stdout) {
|
|
21
21
|
return parse(stdout, { format: "unix" });
|
|
22
22
|
}
|
|
@@ -64,11 +64,7 @@ var _lookup = ({
|
|
|
64
64
|
const { promise, resolve, reject } = pFactory();
|
|
65
65
|
const result = [];
|
|
66
66
|
const lookupFlow = IS_WIN ? IS_WIN2025_PLUS ? "pwsh" : "wmic" : "ps";
|
|
67
|
-
const {
|
|
68
|
-
parse: parse2,
|
|
69
|
-
cmd,
|
|
70
|
-
args
|
|
71
|
-
} = LOOKUPS[lookupFlow];
|
|
67
|
+
const { parse: parse2, cmd, args } = LOOKUPS[lookupFlow];
|
|
72
68
|
const callback = (err, { stdout }) => {
|
|
73
69
|
if (err) {
|
|
74
70
|
reject(err);
|
|
@@ -199,7 +195,7 @@ var kill = (pid, opts, next) => {
|
|
|
199
195
|
var normalizeOutput = (data) => data.reduce((m, d) => {
|
|
200
196
|
const pid = (d.PID || d.ProcessId)?.[0];
|
|
201
197
|
const ppid = (d.PPID || d.ParentProcessId)?.[0];
|
|
202
|
-
const _cmd = d.CMD || d.CommandLine || d.COMMAND || [];
|
|
198
|
+
const _cmd = d.CMD || d.CommandLine || d.COMMAND || d.ARGS || [];
|
|
203
199
|
const cmd = _cmd.length === 1 ? _cmd[0].split(/\s+/) : _cmd;
|
|
204
200
|
if (pid && cmd.length > 0) {
|
|
205
201
|
const c = cmd.findIndex((_v, i) => isBin(cmd.slice(0, i).join(" ")));
|