@xtrctio/wait-for-keypress
v0.0.4
Published
Wait for a given keypress
Downloads
3
Maintainers
Readme
wait-for-keypress
Usage
const waitForKeypress = require('@xtrctio/wait-for-keypress');
(async () => {
const result = await waitForKeypress({a: 'Success!', f: 'Failure!'});
})()
API
waitForKeypress(keyConfig) ⇒ Promise.<*>
Wait for configured keys to be pressed
Kind: global function
| Param | Type | Description | | --- | --- | --- | | keyConfig | object | Object matching keys to their return value |