10000 GitHub - thlorenz/parse-key: Parses strings into key objects of the same format as the ones emitted by nodejs readline.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Parses strings into key objects of the same format as the ones emitted by nodejs readline.

License

Notifications You must be signed in to change notification settings

thlorenz/parse-key

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-key build status

Parses strings into key objects of the same format as the ones emitted by nodejs readline.

Counter part to stringify-key.

Installation

6B7F
npm i parse-key

Usage

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' }

Caveats

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.

About

Parses strings into key objects of the same format as the ones emitted by nodejs readline.

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0