Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

expose pid, kill, close and exit

  • Loading branch information...
commit ed74b8c0a38f40af791cf789c6bc4314591be962 1 parent b6ab98d
@substack authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 index.js
View
11 index.js
@@ -20,5 +20,16 @@ module.exports = function (cmd, args, opts) {
});
var dup = duplexer(ps.stdin, ps.stdout);
+
+ dup.stdin = ps.stdin;
+ dup.stderr = ps.stderr;
+ dup.stdout = ps.stdout;
+ dup.pid = ps.pid;
+ dup.kill = ps.kill.bind(ps);
+
+ [ 'exit', 'close' ].forEach(function (name) {
+ ps.on(name, dup.emit.bind(dup, name));
+ });
+
return dup;
};
Please sign in to comment.
Something went wrong with that request. Please try again.