Skip to content

Instantly share code, notes, and snippets.

@natpen
Created July 29, 2015 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natpen/eb8f36635a75f2e9bf8f to your computer and use it in GitHub Desktop.
Save natpen/eb8f36635a75f2e9bf8f to your computer and use it in GitHub Desktop.
var spawn = require('child_process').spawn;
var csv = require('csv');
var ls = spawn('git', ['log']);
ls.on('close', function (code) {
console.log('exit code ' + code);
});
var parser = csv.parse({ delimiter: '\t' });
parser.on('data', function(data) {
setTimeout(function() {
console.log('data');
}, 30);
});
parser.on('end', function() {
console.log('parser end');
});
parser.on('finish', function() {
console.log('parser finish');
});
ls.stdout.pipe(parser);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment