# current-processes

> Get a snapshot of the currently running processes, OS-agnostic

Latest version **0.2.1** (published 2014-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install current-processes
pnpm add current-processes
yarn add current-processes
bun add current-processes
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2014-07-01 |
| First published | 2014-06-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 96 |
| Author | Bran van der Meer |
| Maintainers | branneman |
| Keywords | processes, os, cpu, memory, usage, tasks, tasklist, top, vtop, ps, wmi, wmic |

## Links

- npm: https://www.npmjs.com/package/current-processes
- Repository: https://github.com/branneman/current-processes
- Issues: https://github.com/branneman/current-processes/issues
- npm.io page: https://npm.io/package/current-processes

## Dependencies (2)

- [async](https://npm.io/package/async.md) ^0.9.0
- [csv-parse](https://npm.io/package/csv-parse.md) 0.0.5

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2014-07-01
- 0.2.0 — 2014-06-23
- 0.1.0 — 2014-06-19

## README

# current-processes
[![Build Status](https://travis-ci.org/branneman/current-processes.svg?branch=master)](https://travis-ci.org/branneman/current-processes)
[![Coverage Status](https://img.shields.io/coveralls/branneman/current-processes.svg)](https://coveralls.io/r/branneman/current-processes)
[![Dependency Status](http://img.shields.io/david/branneman/current-processes.svg)](https://david-dm.org/branneman/current-processes)
[![npm version](http://img.shields.io/npm/v/current-processes.svg)](https://www.npmjs.org/package/current-processes)
[![npm Downloads](http://img.shields.io/npm/dm/current-processes.svg)](https://www.npmjs.org/package/current-processes)

Node.js library to get a snapshot of the currently running processes, OS-agnostic. Needs root/Admin permissions.

## Usage example
```js
var _ = require('lodash');
var ps = require('current-processes');

ps.get(function(err, processes) {

    var sorted = _.sortBy(processes, 'cpu');
    var top5  = sorted.reverse().splice(0, 5);

    console.log(top5);
});
```

## Process object
The library will return an array consisting of multiple process objects, structured like this:
```js
{
    pid: 1337,               // Process ID
    name: 'chrome',          // Process name
    mem: {
        private: 23054560,   // Private memory, in bytes
        virtual: 78923608,   // Virtual memory (private + shared libraries + swap space), in bytes
        usage: 0.02    	     // Used physical memory (%) by this process
    },
    cpu: 0.3                 // CPU usage (%) as reported by `ps` and `wmic`
}
```

## Platform-specific notes
### Windows
WMI (specifically `wmic`) is used to gather the information itself. WMI is fairly slow the first time it's called, it
might even take up to 2-3 seconds. Make sure your app will gracefully handle this. Subsequent calls will be much faster.

---
_Source: https://npm.io/package/current-processes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
