Comparing version 6.0.0 to 6.1.0
@@ -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']) |
{ | ||
"name": "ps-list", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "Get running processes", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -1,2 +0,2 @@ | ||
# ps-list [![Build Status](https://travis-ci.org/sindresorhus/ps-list.svg?branch=master)](https://travis-ci.org/sindresorhus/ps-list) [![Build status](https://ci.appveyor.com/api/projects/status/i733mfqw11sja2xf/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/ps-list/branch/master) | ||
# ps-list [![Build Status](https://travis-ci.org/sindresorhus/ps-list.svg?branch=master)](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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50
49382