Skip to content

nanobot248/processinfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

processinfo

nodejs module for getting process information. Uses "ps" and currently only works on Linux systems and other environments with a compatible "ps" command.

Usage

Get all columns

This snippet lists all columns known to the ProcessList class by using the column names listed in the ProcessList.defaultColumns array.

var Ps = require("../lib/package.js");

var ps = new Ps();
ps.get(function(err, data) {
  console.log("Process information: ", data);
});

Only get some specific columns

This code returns only four columns.

var Ps = require("../lib/package.js");

var ps = new Ps({
  columns: ["processId", "parentProcessId", "lightweightProcessId", "command"]
});
ps.get(function(err, data) {
  console.log("Process information: ", data);
});

Don't list threads

The following code only lists real processes, but skips all lightweight processes (threads).

var Ps = require("../lib/package.js");

var ps = new Ps({
  listThreads: false
});
ps.get(function(err, data) {
  console.log("Process information: ", data);
});

About

Node module for requesting process information.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published