procps
v0.4.1
Published
Node.js bindings for procps, a library that provides information about processes using the `/proc` filesystem
Downloads
34
Readme
procps
Node.js bindings for procps, a library that provides information about processes using
the /proc
filesystem, using the better maintained fork.
Supported Platforms
Unixes with a /proc
directory only. Tested on arch linux
and ubuntu
.
Installation
npm install procps
Table of Contents generated with DocToc
- Example
- API
- readproctab::flags
- readproctab::flagsFillAll
- readproctab(flags_) → {Array.}
- sysinfo::getdiskstat() → {Object}
- sysinfo::getPidDigits() → {number}
- sysinfo::getslabinfo() → {Array.}
- sysinfo::getstat() → {Object}
- sysinfo::loadavg() → {Array.}
- sysinfo::meminfo(unit) → {Object}
- sysinfo::uptime() → {Object}
- sysinfo::uptimeSince() → {Object}
- sysinfo::uptimeString(humanReadable) → {String}
- vminfo() → {Object}
- LICENSE
Example
var procps = require('procps');
var proctab = procps.readproctab();
var bycommand = proctab.reduce(function (acc, p) {
acc[p.cmd] = p;
return acc;
}, {});
console.log(bycommand.node)
{ cutime: 0,
majFlt: 0,
vmSize: 661152,
resident: 0,
startCode: 4194304,
rgroup: 'kermit',
egid: 1000,
pgrp: 13690,
minFlt: 3199,
startTime: 3344937,
suser: 'kermit',
fgid: 1000,
processor: 0,
startStack: 76310960,
sgroup: 'kermit',
cmajFlt: 0,
flags: 4202496,
rss: 2431,
tid: 13834,
...
environ:
[ 'LC_PAPER=en_US.UTF-8',
...
'npm_node_execpath=/usr/bin/node' ],
nlwp: 2,
kstkEsp: 76309144,
fuser: 'kermit',
cmdline: [ 'node', 'example/readproctab.js' ],
sigcatch: '0000000180014202',
utime: 2,
vmRss: 9724,
wchan: 4294967295,
euid: 1000,
sigignore: '0000000000001000',
share: 0 }
API
Unofficial procps documentation.
So far readproctab
has been implemented, but lots more to come, i.e. meminfo
.
generated with docme
LICENSE
MIT