Skip to content
Get running processes
Branch: master
Clone or download
Latest commit 158f5db Mar 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore Require Node.js 4 Jul 27, 2017
.npmrc
.travis.yml
fastlist.exe Improve Windows performance (#21) Oct 13, 2018
index.d.ts
index.js
index.test-d.ts
license Require Node.js 4 Jul 27, 2017
package.json 6.2.0 Mar 8, 2019
readme.md
test.js Add `uid` property for macOS and Linux (#25) Jan 20, 2019

readme.md

ps-list Build Status

Get running processes

Works on macOS, Linux, and Windows.

Install

$ npm install ps-list

Usage

const psList = require('ps-list');

(async () => {
	console.log(await psList());
	//=> [{pid: 3213, name: 'node', cmd: 'node test.js', ppid: 1, uid: 501, cpu: 0.1, memory: 1.5}, …]
})();

The cmd, cpu, memory, and uid properties are not supported on Windows.

API

psList([options])

Returns a Promise<Array> with the running processes.

options

Type: Object

all

Type: boolean
Default: true

Include other users' processes as well as your own.

On Windows this has no effect and will always be the users' own processes.

License

MIT © Sindre Sorhus

You can’t perform that action at this time.