Skip to content

Instantly share code, notes, and snippets.

@jrunning
Last active October 30, 2017 16:52
Show Gist options
  • Save jrunning/728c8e6525c807ff811ba3a0970c252b to your computer and use it in GitHub Desktop.
Save jrunning/728c8e6525c807ff811ba3a0970c252b to your computer and use it in GitHub Desktop.
require('readline',{stdin:i,stdout:o,exit:e}=process).emitKeypressEvents(i)
w=s=>o.write(s)
n=0
i.on('keypress',c=>w(c)&&c.charCodeAt()-97-n?e(w(`
Fail`)):!n++?s=d():n>25&&e(w(`
`+(d()-s)))).setRawMode(d=Date.now)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment