Last active
August 29, 2015 14:08
-
-
Save ddnn55/f23596cc44b49229d043 to your computer and use it in GitHub Desktop.
minimal unix stdin line processor in NodeJS
This file contains hidden or 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
#!/usr/bin/env node | |
var readline = require('readline'); | |
var devnull = require('dev-null'); | |
var rl = readline.createInterface({ | |
input: process.stdin, | |
output: devnull() | |
}); | |
rl.on('line', function(line) { | |
console.error('stdin line:', line); | |
}); | |
rl.on('close', function() { | |
console.error('stdin ended.'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment