Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
- });
Add Comment
Please, Sign In to add comment