{"_id":"@absolutejs/hotkeys","_rev":"2-6fc089be57a8d7e7dbe1a7f6bddaa8ba","name":"@absolutejs/hotkeys","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@absolutejs/hotkeys","version":"0.1.0","keywords":["hotkeys","keybindings","keyboard","shortcuts"],"author":"Alex Kahn","license":"MIT","_id":"@absolutejs/hotkeys@0.1.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/hotkeys","bugs":{"url":"https://github.com/absolutejs/hotkeys/issues"},"dist":{"shasum":"b74a90a95c3a02d6ecbc1da1d7c7db19b5b11624","tarball":"https://registry.npmjs.org/@absolutejs/hotkeys/-/hotkeys-0.1.0.tgz","fileCount":11,"integrity":"sha512-tYZOsB9nWTRNo+ClSutR0xke7/gohIFgMN45b7s19mm9fJ7CKHE20zmfNUTgneKmVh9s0nYFSb9QfIBc3xGTMg==","signatures":[{"sig":"MEUCIQCWWIbjbMwbcNrDUy3ony+Fh01oMpMd3iX0JMUoGl6n3gIgYX9Te753IUhbVgx5kOZZ/kVZRHjelkKTS4e6qfXx+28=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24314},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"b74a90a95c3a02d6ecbc1da1d7c7db19b5b11624","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./vue":{"types":"./dist/vue.d.ts","import":"./dist/vue.js","default":"./dist/vue.js"}},"scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/vue.ts --outdir dist --root ./src --target=browser --external vue && tsc --emitDeclarationOnly --project tsconfig.json","release":"bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-tYZOsB9nWTRNo+ClSutR0xke7/gohIFgMN45b7s19mm9fJ7CKHE20zmfNUTgneKmVh9s0nYFSb9QfIBc3xGTMg==","repository":{"url":"git+https://github.com/absolutejs/hotkeys.git","type":"git"},"_npmVersion":"10.8.3","description":"Framework-agnostic keyboard shortcuts: chords, sequences, scopes and a self-describing binding registry.","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vue":"3.5.13","@types/bun":"latest","typescript":"5.8.3"},"peerDependencies":{"vue":">=3.4.0"},"peerDependenciesMeta":{"vue":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/hotkeys_0.1.0_1785463092373_0.5507757776597211","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"author":"Alex Kahn","bugs":{"url":"https://github.com/absolutejs/hotkeys/issues"},"description":"Framework-agnostic keyboard shortcuts: chords, sequences, scopes and a self-describing binding registry.","devDependencies":{"@types/bun":"latest","typescript":"5.8.3","vue":"3.5.13"},"exports":{".":{"default":"./dist/index.js","import":"./dist/index.js","types":"./dist/index.d.ts"},"./vue":{"default":"./dist/vue.js","import":"./dist/vue.js","types":"./dist/vue.d.ts"},"./package.json":"./package.json"},"homepage":"https://github.com/absolutejs/hotkeys","keywords":["hotkeys","keybindings","keyboard","shortcuts"],"license":"MIT","main":"./dist/index.js","name":"@absolutejs/hotkeys","peerDependencies":{"vue":">=3.4.0"},"peerDependenciesMeta":{"vue":{"optional":true}},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/absolutejs/hotkeys.git"},"scripts":{"build":"rm -rf dist && bun build src/index.ts src/vue.ts --outdir dist --root ./src --target=browser --format=esm --splitting --external vue && tsc --emitDeclarationOnly --project tsconfig.json","release":"bun run build && bun publish","test":"bun test","typecheck":"tsc --noEmit"},"type":"module","types":"./dist/index.d.ts","version":"0.1.1","_id":"@absolutejs/hotkeys@0.1.1","_integrity":"sha512-z2wEA3BAra+ziK2aK6d1ZRCa44dPKanLWNH0ZU50G/3g9obem83KbxzPw52VflBZky5AjkBm6sPBiZTgQ08QAA==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"3a92ea86661a7dd459f2a9a748a02a011b6f1793","dist":{"integrity":"sha512-z2wEA3BAra+ziK2aK6d1ZRCa44dPKanLWNH0ZU50G/3g9obem83KbxzPw52VflBZky5AjkBm6sPBiZTgQ08QAA==","shasum":"3a92ea86661a7dd459f2a9a748a02a011b6f1793","tarball":"https://registry.npmjs.org/@absolutejs/hotkeys/-/hotkeys-0.1.1.tgz","fileCount":12,"unpackedSize":19544,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC/MIOgiM6Es/b+4f8JV8tpq9BAP9FWDnGL9rOXdiBo3AIhAMNZcMkHSNMdguAcUx2TVoz1pSqPfYE9C2Yec0FPOeFZ"}]},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"directories":{},"maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hotkeys_0.1.1_1785467633408_0.39930439657302785"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-31T01:58:12.202Z","modified":"2026-07-31T03:13:53.788Z","0.1.0":"2026-07-31T01:58:12.504Z","0.1.1":"2026-07-31T03:13:53.559Z"},"bugs":{"url":"https://github.com/absolutejs/hotkeys/issues"},"author":"Alex Kahn","license":"MIT","homepage":"https://github.com/absolutejs/hotkeys","keywords":["hotkeys","keybindings","keyboard","shortcuts"],"repository":{"type":"git","url":"git+https://github.com/absolutejs/hotkeys.git"},"description":"Framework-agnostic keyboard shortcuts: chords, sequences, scopes and a self-describing binding registry.","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"readme":"# @absolutejs/hotkeys\n\nKeyboard shortcuts that stay honest: chords, sequences, scopes, and a registry\nthat can describe itself — so the shortcuts-help overlay is generated from the\nbindings that actually exist rather than hand-maintained beside them.\n\n```bash\nbun add @absolutejs/hotkeys\n```\n\n## Core (no framework)\n\n```ts\nimport { hotkeys, listenForHotkeys } from \"@absolutejs/hotkeys\";\n\nconst stop = listenForHotkeys();\n\nhotkeys.register(\"j\", selectNext, { description: \"Next\", group: \"Navigation\" });\nhotkeys.register(\"mod+k\", openPalette, { description: \"Command palette\" });\nhotkeys.register(\"g i\", goToInbox, { description: \"Go to inbox\" });\n```\n\n- **`mod`** is Meta on Apple platforms and Control everywhere else, so one\n  binding string is correct on every machine.\n- **Sequences** (`g i`) fire only when typed in order within a second; a wrong\n  key aborts rather than lingering.\n- **Text entry is respected.** Bindings don't fire while an `input`,\n  `textarea` or contenteditable has focus unless they pass\n  `allowInInput: true` — typing \"e\" in a reply must never dismiss a thread.\n\n## Scopes\n\nA scope is a stack. Push one when a modal or a focused list takes over, and\nits bindings win over the app-wide ones until it pops.\n\n```ts\nhotkeys.register(\"escape\", closeApp);\nhotkeys.register(\"escape\", closeModal, { scope: \"modal\" });\n\nhotkeys.pushScope(\"modal\"); // escape now closes the modal\nhotkeys.popScope(\"modal\");  // ...and the app-wide binding is back\n```\n\n`when: () => boolean` gates a binding at press time for finer conditions.\n\n## Vue\n\n```ts\nimport { useHotkeys, useHotkeyScope } from \"@absolutejs/hotkeys/vue\";\n\nuseHotkeyScope(\"inbox\");\nuseHotkeys({\n  e: { description: \"Dismiss\", group: \"Actions\", handler: dismiss },\n  j: selectNext,\n  k: selectPrevious,\n});\n```\n\nBindings unregister with the component's effect scope, so a closed modal\ncan't leave a live shortcut behind.\n\n## Shortcuts help\n\n```ts\nimport { groupedBindings } from \"@absolutejs/hotkeys\";\n\ngroupedBindings(); // [{ group: \"Navigation\", bindings: [{ display: \"⌘ K\", … }] }]\n```\n\nOnly described bindings appear: if it isn't worth naming, it isn't worth\nteaching.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}