Created
September 20, 2015 15:16
-
-
Save lagondo/8bd0775435d483c4d9e2 to your computer and use it in GitHub Desktop.
stdin readline and close
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 rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
rl.on('line', function(line) { | |
console.log('Line', line) | |
}) | |
rl.on('close', function() { | |
console.log('Closed'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment