Skip to content

Instantly share code, notes, and snippets.

@octocat
Created August 25, 2011 02:43
Show Gist options
  • Save octocat/1169852 to your computer and use it in GitHub Desktop.
Save octocat/1169852 to your computer and use it in GitHub Desktop.
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;
};
@slvnperron
Copy link

Yes, it is. (nodejs)

@codemilli
Copy link

@R2D221 CS might mean the CoffeeScript, I think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment