Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.

ConsenSys-archive/ps-list

 
 

Repository files navigation

ps-list

Get running processes

Works on macOS, Linux, and Windows.

Fork

This is a fork of ps-list (https://github.com/sindresorhus/ps-list), providing a fully JavaScript implementation (leveraging native operating system utilities), and supports only CommonJS module resolution.

The upstream PR #21 Improve Windows Performance introduces fast-list as a binary dependency (released in ps-list@6.0.0). This fork reverts to use the native Windows task-list util, which is slower, but doesn't require binaries to be bundled with the package.

Install

npm install @trufflesuite/ps-list

Usage

import psList from "@trufflesuite/ps-list";

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

API

psList(options?)

Returns a Promise<object[]> with the running processes.

On macOS and Linux, the name property is truncated to 15 characters by the system. The cmd property can be used to extract the full name.

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

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.

Related

  • tasklist - The JavaScript wrapper around the native Windows tasklist util.

About

Get running processes

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 92.1%
  • TypeScript 7.9%