Guest User

Untitled

a guest
Sep 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. const swipes = [];
  2.  
  3. require('readline')
  4. .createInterface({
  5. input: process.stdin,
  6. output: process.stdout,
  7. terminal: false,
  8. })
  9. .on('line', line => {
  10. console.log('\007'); // beep beep
  11. swipes.push(line.slice(1, line.search('=')));
  12. });
  13.  
  14. process.on('SIGINT', () => {
  15. swipes.forEach(swipe => console.log(`\n${swipe}`));
  16. process.exit();
  17. });
Add Comment
Please, Sign In to add comment