Permalink
Browse files

expose pid, kill, close and exit

  • Loading branch information...
1 parent b6ab98d commit ed74b8c0a38f40af791cf789c6bc4314591be962 @substack committed Oct 2, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 index.js
View
@@ -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;
};

0 comments on commit ed74b8c

Please sign in to comment.