Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const swipes = [];
require('readline')
.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false,
})
.on('line', line => {
console.log('\007'); // beep beep
swipes.push(line.slice(1, line.search('=')));
});
process.on('SIGINT', () => {
swipes.forEach(swipe => console.log(`\n${swipe}`));
process.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment