Parses strings into key objects of the same format as the ones emitted by nodejs readline.
npm install parse-keyParses strings into key objects of the same format as the ones emitted by nodejs readline.
Counter part to stringify-key.
npm i parse-key
``js
var parse = require('parse-key');
parse('ctrl-c') // returns { name: 'c', ctrl: true, meta: false, shift: false, alt: false }
parse('shift-ctrl-c') // returns { name: 'c', ctrl: true, meta: false, shift: true, alt: false }
parse('alt-c') // returns { name: 'c', ctrl: false, meta: false, shift: false, alt: true }
`
For completeness' sake, the alt modifier is parsed and included with the returned key although the nodejs readline does notkey` object nor does it have any effect when the key is emitted.
include it in its