MCPcopy Index your code
hub / github.com/darkguy2008/parallelshell / close

Function close

index.js:68–87  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

66
67// closes all children and the process
68function close (code) {
69 var i, len, closed = 0, opened = 0;
70
71 for (i = 0, len = children.length; i < len; i++) {
72 if (!children[i].exitCode) {
73 opened++;
74 children[i].removeAllListeners('close');
75 children[i].kill("SIGINT");
76 if (verbose) console.log('`' + children[i].cmd + '` will now be closed');
77 children[i].on('close', function() {
78 closed++;
79 if (opened == closed) {
80 process.exit(code);
81 }
82 });
83 }
84 }
85 if (opened == closed) {process.exit(code);}
86
87}
88
89// cross platform compatibility
90if (process.platform === 'win32') {

Callers 1

childCloseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…