🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

keyboard-symbol

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keyboard-symbol

Convert key names to symbols like ⌘, ⇧, ⌥ and many more. Supports common symbols for Mac and Windows keyboards.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

keyboard-symbol

Convert key names to symbols like ⌘, ⇧, ⌥ and many more. Supports common symbols for Mac and Windows keyboards.

Install

npm install keyboard-symbol

Usage

import keyboardSymbol from 'keyboard-symbol'

keyboardSymbol('meta', 'mac')
//=> ⌘

keyboardSymbol('meta', 'win')
//=> ❖

keyboardSymbol('control', 'mac')
//=> ⌃

keyboardSymbol('control', 'win')
//=> ctrl

keyboardSymbol('unknownKeyName', 'mac')
//=> unknownKeyName

API

keyboardSymbol(key, OS)

key

Type: string
Default: ''

Your KeyboardEvent.key.

OS

Type: string
Default: mac

Can be mac or win.

List of symbols

⌃ ⌥ ⌘ ❖ ⇪ ⇧ ↑ → ↓ ← ↩ ⌫ ⌦ ⎋ ⇥ ⇞ ⇟ ␣ ctrl alt (source)

Keywords

key

FAQs

Package last updated on 26 Mar 2020

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