npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xavescor/reatom-hotkey

v2.0.0

Published

Physical keyboard shortcuts as lazy, typed Reatom actions.

Readme

@xavescor/reatom-hotkey

Physical keyboard shortcuts as lazy, typed Reatom actions.

Declare ctrl+s or an order-independent a+b chord and observe it like any other Reatom action. The library owns keyboard state and DOM listener lifecycle while application behavior stays in regular Reatom effects and actions.

  • Layout-independent physical shortcuts based on KeyboardEvent.code.
  • Order-independent chords with exact modifiers.
  • Lazy listeners with automatic cleanup.
  • Native events as action payloads.
  • Full event control for keydown, keyup, repeat, capture and propagation.
  • IME-safe, SSR-safe and iframe-ready.

Installation

npm install @xavescor/reatom-hotkey

Usage

import { effect, getCalls } from '@reatom/core'
import { reatomHotkey } from '@xavescor/reatom-hotkey'

const saveHotkey = reatomHotkey('ctrl+s', {
  editable: false,
  preventDefault: true,
})

effect(() => {
  for (const { payload: event } of getCalls(saveHotkey)) {
    console.log('Save requested', event)
  }
})

reatomHotkey returns a Reatom action carrying the original KeyboardEvent. Its DOM listeners exist only while the action is observed.

Syntax

Letters and digits refer to physical keyboard codes, not produced characters:

  • a matches KeyboardEvent.code === 'KeyA'
  • ctrl+s combines a key with an exact modifier set
  • a+b declares an order-independent chord
  • ctrl+a+b combines modifiers and a chord
  • named keys include escape, arrowleft, f12, slash and numpad1

Supported modifiers are alt, ctrl (or control), meta and shift. Single-letter shortcuts must be lowercase. Invalid declarations throw immediately.

Options

| Option | Default | Behavior | | --- | --- | --- | | document | globalThis.document | Document to listen on. Pass an iframe document when needed. | | trigger | 'keydown' | Invoke the action on keydown or keyup. | | capture | false | Listen during the capture phase. | | repeat | true | Whether to handle repeated keyboard events. | | editable | true | Whether to handle events from editable controls. | | preventDefault | false | Prevent the accepted event's browser default. | | propagation | 'allow' | Allow, stop or immediately stop event propagation. | | name | normalized declaration | Reatom action name, such as hotkey.ctrl+s. |

The library works without a global document, making hotkeys safe to create during SSR. Pass document explicitly for iframes and other browsing contexts.