Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
21K
decreased by-10.39%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc