@webpod/ps 0.0.1 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpod/ps",
3
- "version": "0.0.1",
3
+ "version": "0.1.1",
4
4
  "description": "A process lookup utility",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -42,24 +42,24 @@
42
42
  ],
43
43
  "dependencies": {
44
44
  "@webpod/ingrid": "^0.0.0-beta.3",
45
- "zurk": "^0.10.0"
45
+ "zurk": "^0.11.2"
46
46
  },
47
47
  "devDependencies": {
48
- "@types/node": "^22.10.2",
48
+ "@types/node": "^22.13.16",
49
49
  "c8": "^10.1.3",
50
- "concurrently": "^9.1.0",
51
- "esbuild": "^0.24.2",
52
- "esbuild-node-externals": "^1.16.0",
50
+ "concurrently": "^9.1.2",
51
+ "esbuild": "^0.25.2",
52
+ "esbuild-node-externals": "^1.18.0",
53
53
  "esbuild-plugin-entry-chunks": "^0.1.15",
54
54
  "eslint": "^8.57.0",
55
55
  "eslint-config-qiwi": "^2.1.3",
56
- "fast-glob": "^3.3.2",
56
+ "fast-glob": "^3.3.3",
57
57
  "minimist": "^1.2.8",
58
58
  "mocha": "^10.8.2",
59
59
  "sinon": "^18.0.1",
60
60
  "ts-node": "^10.9.2",
61
- "typedoc": "^0.27.5",
62
- "typescript": "^5.7.2"
61
+ "typedoc": "^0.28.1",
62
+ "typescript": "^5.8.2"
63
63
  },
64
64
  "repository": {
65
65
  "type": "git",
@@ -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 = /(\r\n)|(\n\r)|\n|\r/;
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) => (out == null ? void 0 : out.indexOf("CommandLine")) === 0);
136
- _stdout.splice(_stdout.length - 1, 1);
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,15 +255,13 @@ var makeDeferred = () => {
257
255
  });
258
256
  return { resolve, reject, promise };
259
257
  };
260
- var makePseudoDeferred = (r = {}) => {
261
- return {
262
- promise: r,
263
- resolve: identity,
264
- reject(e) {
265
- throw e;
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;
@@ -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 = /(\r\n)|(\n\r)|\n|\r/;
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?.indexOf("CommandLine") === 0);
75
- _stdout.splice(_stdout.length - 1, 1);
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,15 +191,13 @@ var makeDeferred = () => {
193
191
  });
194
192
  return { resolve, reject, promise };
195
193
  };
196
- var makePseudoDeferred = (r = {}) => {
197
- return {
198
- promise: r,
199
- resolve: identity,
200
- reject(e) {
201
- throw e;
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;