Skip to content

Instantly share code, notes, and snippets.

@jrocha
Forked from nzakas/spawn.js
Created August 25, 2012 00:21
Show Gist options
  • Save jrocha/3457813 to your computer and use it in GitHub Desktop.
Save jrocha/3457813 to your computer and use it in GitHub Desktop.
Devil spawn
#!/usr/bin/env node
var child = require('child_process');
var cp = child.spawn("cmd.exe", ["/c", "dir"]);
cp.stdout.on("data", function(data) {
console.log(data.toString());
});
cp.stderr.on("data", function(data) {
console.error(data.toString());
});
// Using Node.js v0.8.6 on Windows 8 RC 64-bit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment