+3
-2
@@ -30,3 +30,3 @@ 'use strict'; | ||
| await Promise.all(['comm', 'args', 'ppid', '%cpu', '%mem'].map(async cmd => { | ||
| await Promise.all(['comm', 'args', 'ppid', 'uid', '%cpu', '%mem'].map(async cmd => { | ||
| const {stdout} = await execFile('ps', [flags, `pid,${cmd}`], {maxBuffer: TEN_MEGABYTES}); | ||
@@ -50,3 +50,3 @@ | ||
| return Object.entries(ret) | ||
| .filter(([, value]) => value.comm && value.args && value.ppid && value['%cpu'] && value['%mem']) | ||
| .filter(([, value]) => value.comm && value.args && value.ppid && value.uid && value['%cpu'] && value['%mem']) | ||
| .map(([key, value]) => ({ | ||
@@ -57,2 +57,3 @@ pid: Number.parseInt(key, 10), | ||
| ppid: Number.parseInt(value.ppid, 10), | ||
| uid: Number.parseInt(value.uid, 10), | ||
| cpu: Number.parseFloat(value['%cpu']), | ||
@@ -59,0 +60,0 @@ memory: Number.parseFloat(value['%mem']) |
+1
-1
| { | ||
| "name": "ps-list", | ||
| "version": "6.0.0", | ||
| "version": "6.1.0", | ||
| "description": "Get running processes", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+3
-3
@@ -1,2 +0,2 @@ | ||
| # ps-list [](https://travis-ci.org/sindresorhus/ps-list) [](https://ci.appveyor.com/project/sindresorhus/ps-list/branch/master) | ||
| # ps-list [](https://travis-ci.org/sindresorhus/ps-list) | ||
@@ -22,7 +22,7 @@ > Get running processes | ||
| console.log(await psList()); | ||
| //=> [{pid: 3213, name: 'node', cmd: 'node test.js', ppid: 1, cpu: 0.1, memory: 1.5}, …] | ||
| //=> [{pid: 3213, name: 'node', cmd: 'node test.js', ppid: 1, uid: 501, cpu: 0.1, memory: 1.5}, …] | ||
| })(); | ||
| ``` | ||
| > The `cmd`, `cpu`, and `memory` properties are not supported on Windows. | ||
| > The `cmd`, `cpu`, `memory`, and `uid` properties are not supported on Windows. | ||
@@ -29,0 +29,0 @@ |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
50
2.04%49382
-0.19%