🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

parse-key

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-key

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

0.2.1
latest
Source
npm
Version published
Weekly downloads
29K
-13.36%
Maintainers
1
Weekly downloads
 
Created
Source

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

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.

Keywords

readline

FAQs

Package last updated on 02 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts