Created
August 25, 2011 02:43
-
-
Save octocat/1169852 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("./rx"); | |
var child_process = require("child_process"); | |
for (var k in child_process) { | |
exports[k] = child_process[k]; | |
} | |
exports.exec = function (command, options) { | |
var subject = new Rx.AsyncSubject(); | |
var handler = function (err, stdout, stderr) { | |
if (err !== null) { | |
subject.OnError(err); | |
} else { | |
subject.OnNext({ stdout: stdout, stderr: stderr }); | |
subject.OnCompleted(); | |
} | |
}; | |
child_process.exec(command, options, handler); | |
return subject; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, it is. (nodejs)