Skip to content

ossf-cve-benchmark/CVE-2018-16460

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

ps

A Node.js module for looking up running processes.

Install

$ npm install ps

Usage

var ps = require('ps');

// A simple pid lookup
ps.lookup({ pid: 12345 }, function(err, proc) {
    if (err) {throw err;}
    if (proc) {
        console.log(proc);  // Process name, something like "node" or "bash"
    } else {
        console.log('No such process');
    }
});

// Lookup processes in a list of pids and format them
var query = {
    pid: [123, 234, 345],  // Look up these pids
    format: 'pid comm',    // Retrieve the pid and name, like running `ps -o pid= -o comm=`
    parse: true            // Parse the output results into a 2D array
};
ps.lookup(query, function(err, results) {
    if (err) {throw err;}
    if (results) {
        results.forEach(function(proc) {
            console.log('PID: ' + proc[0] + '; Name: ' + proc[1]);
        });
    }
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published