Parses strings into key objects of the same format as the ones emitted by nodejs readline.
Counter part to stringify-key.
var parse = require('parse-key'); parse('ctrl-c') // returns { name: 'c', ctrl: true, meta: false, shift: false, alt: false, sequence: '\u0003' } parse('shift-ctrl-c') // returns { name: 'c', ctrl: true, meta: false, shift: true, alt: false, sequence: '\u0003' } parse('alt-c') // returns { name: 'c', ctrl: false, meta: false, shift: false, alt: true, sequence: 'c' }
For completeness' sake, the alt
modifier is parsed and included with the returned key
although the nodejs readline does not include it in its key
object nor does it have any effect when the key is emitted.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4