
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
keyboard-shortcut-string
Advanced tools
Creates a canonical keyboard shortcut string from a shortcut source string
Creates a canonical keyboard shortcut string from the given shortcut string input.
This module does not bind shortcuts to keyboard events – its only job is to parse shortcut strings, and return predictable results. A good use for this module would be to support a keystroke module's event handler mapping.
Examples:
console.log(getCanonicalShortcut('ctrl s'));
// 'ctrl s'
console.log(getCanonicalShortcut('s ctrl'));
// 'ctrl s'
console.log(getCanonicalShortcut('s ctrl'));
// 'ctrl s'
console.log(getCanonicalShortcut('shift ctrl s'));
// 'shift ctrl s'
console.log(getCanonicalShortcut('ctrl shift s'));
// 'shift ctrl s'
console.log(getCanonicalShortcut('S CTRL SHIFT'));
// 'shift ctrl s'
Modifier keys are extracted from the input and placed in a predictable order at the front of the result.
Only one non-modifier key component is allowed: "alt s" works, but "alt s h"
will throw.
Non-modifier keys can be almost anything: "s", "S", "space", "ESC", and lowercase is always returned.
This source is heavily sourced from MooTools Keyboard.parse.
MIT
FAQs
Creates a canonical keyboard shortcut string from a shortcut source string
We found that keyboard-shortcut-string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.