Skip to content

Instantly share code, notes, and snippets.

@armetiz
Created August 27, 2012 14:57
Show Gist options
  • Save armetiz/3489256 to your computer and use it in GitHub Desktop.
Save armetiz/3489256 to your computer and use it in GitHub Desktop.
var spawn = require('child_process').spawn,
grep = spawn('grep', ['-v Foo', 'file.txt']);
grep.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
grep.stderr.on('data', function (data) {
console.log('stderr: ' + data);
});
grep.on('exit', 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