Skip to content

A node.js binding to loop calling of to getpgid() through possible process IDs to determine child processes of a parent process given the parent process ID.

Notifications You must be signed in to change notification settings

paulgration/node-getcpids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-getcpids

Given a (parent) process ID, getcpids will return an array of child process IDs.

  var getcpids = require('getcpids');

  var cpids = getcpids(parent.pid);

Came across a situation recently when spawning an instance of a program with pty.js, the process id was available but child process IDs of the program weren't. When the binary finished it left the child processes orphaned which can take a while to expire. Writing getcpids (which loops from 0 - 32767 calling getpgid) creates and returns an array of child process IDs which could be used to kill the orphans after the parent process ended.

About

A node.js binding to loop calling of to getpgid() through possible process IDs to determine child processes of a parent process given the parent process ID.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published