@webpod/ps 0.0.0-beta.9 → 0.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 +13 -11
- package/target/cjs/index.cjs +18 -22
- package/target/esm/index.mjs +15 -19
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpod/ps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "A process lookup utility",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "target/cjs/index.cjs",
|
|
10
|
+
"module": "target/esm/index.mjs",
|
|
11
|
+
"types": "target/dts/index.d.ts",
|
|
10
12
|
"exports": {
|
|
11
13
|
".": {
|
|
12
14
|
"types": "./target/dts/index.d.ts",
|
|
@@ -40,24 +42,24 @@
|
|
|
40
42
|
],
|
|
41
43
|
"dependencies": {
|
|
42
44
|
"@webpod/ingrid": "^0.0.0-beta.3",
|
|
43
|
-
"zurk": "^0.
|
|
45
|
+
"zurk": "^0.10.2"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^22.
|
|
47
|
-
"c8": "^10.1.
|
|
48
|
-
"concurrently": "^9.
|
|
49
|
-
"esbuild": "^0.
|
|
50
|
-
"esbuild-node-externals": "^1.
|
|
48
|
+
"@types/node": "^22.12.0",
|
|
49
|
+
"c8": "^10.1.3",
|
|
50
|
+
"concurrently": "^9.1.2",
|
|
51
|
+
"esbuild": "^0.24.2",
|
|
52
|
+
"esbuild-node-externals": "^1.16.0",
|
|
51
53
|
"esbuild-plugin-entry-chunks": "^0.1.15",
|
|
52
54
|
"eslint": "^8.57.0",
|
|
53
55
|
"eslint-config-qiwi": "^2.1.3",
|
|
54
|
-
"fast-glob": "^3.3.
|
|
56
|
+
"fast-glob": "^3.3.3",
|
|
55
57
|
"minimist": "^1.2.8",
|
|
56
|
-
"mocha": "^10.
|
|
58
|
+
"mocha": "^10.8.2",
|
|
57
59
|
"sinon": "^18.0.1",
|
|
58
60
|
"ts-node": "^10.9.2",
|
|
59
|
-
"typedoc": "^0.
|
|
60
|
-
"typescript": "^5.
|
|
61
|
+
"typedoc": "^0.27.6",
|
|
62
|
+
"typescript": "^5.7.3"
|
|
61
63
|
},
|
|
62
64
|
"repository": {
|
|
63
65
|
"type": "git",
|
package/target/cjs/index.cjs
CHANGED
|
@@ -48,16 +48,16 @@ var __async = (__this, __arguments, generator) => {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
// src/main/ts/index.ts
|
|
51
|
-
var
|
|
52
|
-
__export(
|
|
53
|
-
default: () =>
|
|
51
|
+
var index_exports = {};
|
|
52
|
+
__export(index_exports, {
|
|
53
|
+
default: () => index_default,
|
|
54
54
|
kill: () => kill,
|
|
55
55
|
lookup: () => lookup,
|
|
56
56
|
lookupSync: () => lookupSync,
|
|
57
57
|
tree: () => tree,
|
|
58
58
|
treeSync: () => treeSync
|
|
59
59
|
});
|
|
60
|
-
module.exports = __toCommonJS(
|
|
60
|
+
module.exports = __toCommonJS(index_exports);
|
|
61
61
|
|
|
62
62
|
// src/main/ts/ps.ts
|
|
63
63
|
var import_node_process = __toESM(require("node:process"), 1);
|
|
@@ -65,7 +65,7 @@ var import_node_fs = __toESM(require("node:fs"), 1);
|
|
|
65
65
|
var import_node_os = require("node:os");
|
|
66
66
|
var import_ingrid = require("@webpod/ingrid");
|
|
67
67
|
var import_spawn = require("zurk/spawn");
|
|
68
|
-
var EOL =
|
|
68
|
+
var EOL = /\n\r?|\r\n?/;
|
|
69
69
|
var IS_WIN = import_node_process.default.platform === "win32";
|
|
70
70
|
var isBin = (f) => {
|
|
71
71
|
if (f === "") return false;
|
|
@@ -109,11 +109,11 @@ var _lookup = ({
|
|
|
109
109
|
} : {
|
|
110
110
|
cmd: "ps",
|
|
111
111
|
args,
|
|
112
|
+
callback,
|
|
113
|
+
sync,
|
|
112
114
|
run(cb2) {
|
|
113
115
|
cb2();
|
|
114
|
-
}
|
|
115
|
-
sync,
|
|
116
|
-
callback
|
|
116
|
+
}
|
|
117
117
|
};
|
|
118
118
|
(0, import_spawn.exec)(ctx);
|
|
119
119
|
return Object.assign(promise, result);
|
|
@@ -132,10 +132,8 @@ var parseProcessList = (output, query = {}) => {
|
|
|
132
132
|
};
|
|
133
133
|
var extractWmic = (stdout) => {
|
|
134
134
|
const _stdout = stdout.split(EOL);
|
|
135
|
-
const beginRow = _stdout.findIndex((out) =>
|
|
136
|
-
_stdout.
|
|
137
|
-
_stdout.splice(0, beginRow);
|
|
138
|
-
return _stdout.join(import_node_os.EOL);
|
|
135
|
+
const beginRow = _stdout.findIndex((out) => out.startsWith("CommandLine"));
|
|
136
|
+
return _stdout.slice(beginRow + 1, -1).join(import_node_os.EOL);
|
|
139
137
|
};
|
|
140
138
|
var pickTree = (list, pid, recursive = false) => {
|
|
141
139
|
const children = list.filter((p) => p.ppid === pid + "");
|
|
@@ -257,21 +255,19 @@ var makeDeferred = () => {
|
|
|
257
255
|
});
|
|
258
256
|
return { resolve, reject, promise };
|
|
259
257
|
};
|
|
260
|
-
var makePseudoDeferred = (r = {}) => {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
};
|
|
268
|
-
};
|
|
258
|
+
var makePseudoDeferred = (r = {}) => ({
|
|
259
|
+
promise: r,
|
|
260
|
+
resolve: identity,
|
|
261
|
+
reject(e) {
|
|
262
|
+
throw e;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
269
265
|
var noop = () => {
|
|
270
266
|
};
|
|
271
267
|
var identity = (v) => v;
|
|
272
268
|
|
|
273
269
|
// src/main/ts/index.ts
|
|
274
|
-
var
|
|
270
|
+
var index_default = { kill, lookup, lookupSync, tree, treeSync };
|
|
275
271
|
// Annotate the CommonJS export names for ESM import in node:
|
|
276
272
|
0 && (module.exports = {
|
|
277
273
|
kill,
|
package/target/esm/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import fs from "node:fs";
|
|
|
4
4
|
import { EOL as SystemEOL } from "node:os";
|
|
5
5
|
import { parse } from "@webpod/ingrid";
|
|
6
6
|
import { exec } from "zurk/spawn";
|
|
7
|
-
var EOL =
|
|
7
|
+
var EOL = /\n\r?|\r\n?/;
|
|
8
8
|
var IS_WIN = process.platform === "win32";
|
|
9
9
|
var isBin = (f) => {
|
|
10
10
|
if (f === "") return false;
|
|
@@ -48,11 +48,11 @@ var _lookup = ({
|
|
|
48
48
|
} : {
|
|
49
49
|
cmd: "ps",
|
|
50
50
|
args,
|
|
51
|
+
callback,
|
|
52
|
+
sync,
|
|
51
53
|
run(cb2) {
|
|
52
54
|
cb2();
|
|
53
|
-
}
|
|
54
|
-
sync,
|
|
55
|
-
callback
|
|
55
|
+
}
|
|
56
56
|
};
|
|
57
57
|
exec(ctx);
|
|
58
58
|
return Object.assign(promise, result);
|
|
@@ -71,10 +71,8 @@ var parseProcessList = (output, query = {}) => {
|
|
|
71
71
|
};
|
|
72
72
|
var extractWmic = (stdout) => {
|
|
73
73
|
const _stdout = stdout.split(EOL);
|
|
74
|
-
const beginRow = _stdout.findIndex((out) => out
|
|
75
|
-
_stdout.
|
|
76
|
-
_stdout.splice(0, beginRow);
|
|
77
|
-
return _stdout.join(SystemEOL);
|
|
74
|
+
const beginRow = _stdout.findIndex((out) => out.startsWith("CommandLine"));
|
|
75
|
+
return _stdout.slice(beginRow + 1, -1).join(SystemEOL);
|
|
78
76
|
};
|
|
79
77
|
var pickTree = (list, pid, recursive = false) => {
|
|
80
78
|
const children = list.filter((p) => p.ppid === pid + "");
|
|
@@ -193,23 +191,21 @@ var makeDeferred = () => {
|
|
|
193
191
|
});
|
|
194
192
|
return { resolve, reject, promise };
|
|
195
193
|
};
|
|
196
|
-
var makePseudoDeferred = (r = {}) => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
};
|
|
204
|
-
};
|
|
194
|
+
var makePseudoDeferred = (r = {}) => ({
|
|
195
|
+
promise: r,
|
|
196
|
+
resolve: identity,
|
|
197
|
+
reject(e) {
|
|
198
|
+
throw e;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
205
201
|
var noop = () => {
|
|
206
202
|
};
|
|
207
203
|
var identity = (v) => v;
|
|
208
204
|
|
|
209
205
|
// src/main/ts/index.ts
|
|
210
|
-
var
|
|
206
|
+
var index_default = { kill, lookup, lookupSync, tree, treeSync };
|
|
211
207
|
export {
|
|
212
|
-
|
|
208
|
+
index_default as default,
|
|
213
209
|
kill,
|
|
214
210
|
lookup,
|
|
215
211
|
lookupSync,
|