npm

Join us for the upcoming webinar, "Enterprise JavaScript done right: the tools you love, the security you need."Sign up here »

process-tree

1.0.3 • Public • Published

process-tree

like ps-tree, but cross-platform, and providing sub-children

Get a tree of processes starting from the children of a given PID.

require("process-tree")(pid, function(err, children){
    if(err){
        console.error(err);
    }else{
        console.log(JSON.stringify(children, null, 4));
        console.assert(children[0].ppid === pid);
        console.log(children[0].children[0].pid);
        console.log(children[0].name); // "Name" from wmic, "comm" from ps
    }
});

install

npm i process-tree

Downloadsweekly downloads

164

version

1.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability