https://github.com/reklatsmasters/node-process-list
Cross-platform native method to receive the list of the launched processes
https://github.com/reklatsmasters/node-process-list
bytes c-plus-plus cpp cross-platform-native js node prebuild prebuilt prebuilt-packages process process-list process-monitor process-tree processes task-list tasklist taskmanager taskmgr
Last synced: 10 months ago
JSON representation
Cross-platform native method to receive the list of the launched processes
- Host: GitHub
- URL: https://github.com/reklatsmasters/node-process-list
- Owner: reklatsmasters
- License: mit
- Created: 2014-08-09T15:22:51.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-10-18T19:09:56.000Z (over 6 years ago)
- Last Synced: 2025-03-26T20:11:09.701Z (10 months ago)
- Topics: bytes, c-plus-plus, cpp, cross-platform-native, js, node, prebuild, prebuilt, prebuilt-packages, process, process-list, process-monitor, process-tree, processes, task-list, tasklist, taskmanager, taskmgr
- Language: C++
- Homepage:
- Size: 479 KB
- Stars: 67
- Watchers: 4
- Forks: 20
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
Cross-platform native method to receive the list of the launched processes
[](https://travis-ci.org/reklatsmasters/node-process-list) [](https://ci.appveyor.com/project/ReklatsMasters/node-process-list) [](https://npmjs.org/package/process-list) [](https://npmjs.org/package/process-list) [](https://npmjs.org/package/process-list)
[](https://greenkeeper.io/)
### Install
```bash
npm i process-list
# or
yarn add process-list
```
It's that easy! npm will download one of the [prebuilt](https://github.com/reklatsmasters/node-process-list/releases/latest) binaries for your OS. If you need to build `process-list`, see [node-gyp](https://npmjs.org/package/node-gyp) for more details.
### Supported OS
* `Windows` Windows 7+, Windows Server 2008 R2+
* `Linux` any Linux-based distributives
* `OS X` *Soon...*
### Usage
```js
const { snapshot } = require("process-list");
const tasks = await snapshot('pid', 'name');
console.log(tasks);
// output
// [{
// name: "1.exe",
// pid: 1234,
// }, ... ]
```
### API
##### `snapshot(...field: String): Promise<[]Object>`
Returns the list of the launched processes.
##### `allowedFields: []String`
List of allowed fields.
* `pid: Number` - process pid
* `ppid: Number` - parent process pid
* `name: String` - process name (title)
* `path: String` - full path to the process binary file
* `threads: Number` - threads per process
* `owner: String` - the owner of the process
* `priority: Number` - an os-specific process priority
* `cmdline: String` - full command line of the process
* `starttime: Date` - the process start date / time
* `vmem: String` - virtual memory size in bytes used by process
* `pmem: String` - physical memory size in bytes used by process
* `cpu: Number` - cpu usage by process in percent
* `utime: String` - amount of time in ms that this process has been scheduled in user mode
* `stime: String` - amount of time that in ms this process has been scheduled in kernel mode
## License
MIT, Copyright © 2014 - 2019 Dmitry Tsvettsikh