Skip to content

Instantly share code, notes, and snippets.

@lagondo
Created September 20, 2015 15:16
Show Gist options
  • Save lagondo/8bd0775435d483c4d9e2 to your computer and use it in GitHub Desktop.
Save lagondo/8bd0775435d483c4d9e2 to your computer and use it in GitHub Desktop.
stdin readline and close
#!/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