Skip to content

Instantly share code, notes, and snippets.

@huttj
Created September 26, 2019 01:27
Show Gist options
  • Save huttj/11a41df0420468331c70b34704bb64ba to your computer and use it in GitHub Desktop.
Save huttj/11a41df0420468331c70b34704bb64ba to your computer and use it in GitHub Desktop.
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
const lines = [];
rl.on('line', line => {
lines.push(line);
});
rl.on('close', () => {
console.log(lines.reverse().join('\n'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment