Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created November 1, 2011 16:39
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 kyanny/1331072 to your computer and use it in GitHub Desktop.
Save kyanny/1331072 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
var spawn = require('child_process').spawn,
wget = spawn('wget', ['http://www.livedoor.com/']);
var rl = require('readline');
var i = rl.createInterface(wget.stdin, wget.stdout, null);
i.on('line', function(line) {
console.log('received: ' + line);
});
i.on('close', function() {
console.log('exit');
process.exit(0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment