Skip to content

Instantly share code, notes, and snippets.

@gjtorikian
Created September 1, 2012 03:24
Show Gist options
  • Save gjtorikian/3563277 to your computer and use it in GitHub Desktop.
Save gjtorikian/3563277 to your computer and use it in GitHub Desktop.
Testing Ag via Node script
var spawn = require('child_process').spawn;
var cmd = spawn(
"/Users/gjtorikian/Developer/cloud9/plugins-server/cloud9.ide.search/darwin_x64/ag",
["-l", "--search-binary", "--nobreak", "--ackmate", "."]);
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