-
-
Save ggreer/3568181 to your computer and use it in GitHub Desktop.
Testing Ag via Node script
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
var spawn = require('child_process').spawn; | |
var cmd = spawn( | |
"./ag", | |
["blah", "."]); | |
cmd.stdout.setEncoding('utf8'); | |
cmd.stdout.on('data', function (data) { | |
console.log('stdout: ' + data); | |
}); | |
cmd.stderr.on('data', function (data) { | |
console.log('stderr: ' + data); | |
}); | |
cmd.on('exit', function (code) { | |
console.log('child process exited with code ' + code); | |
}); | |
cmd.on('end', function (code) { | |
console.log('child process exited with code ' + code); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment