{"_id":"@benjos/spices","_rev":"4-545c455f0d5372965c510423c3d019f5","name":"@benjos/spices","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@benjos/spices","version":"1.0.0","keywords":["constants","typescript"],"author":{"name":"benjos"},"license":"ISC","_id":"@benjos/spices@1.0.0","maintainers":[{"name":"benjos","email":"benjamin.schinkel01@outlook.fr"}],"homepage":"https://github.com/LeBenjos/spices#readme","bugs":{"url":"https://github.com/LeBenjos/spices/issues"},"dist":{"shasum":"e281a0c9313b094b379ab14bfaf30cbd41d8b368","tarball":"https://registry.npmjs.org/@benjos/spices/-/spices-1.0.0.tgz","fileCount":5,"integrity":"sha512-Pta+VoHKCrFjpvGjPsvKxpx9wk4mBFWb1gPZqYgfN2NlR5SX6gy8UHwDGAKSnvQ+lpQLELoLmLeimyAhptDbBQ==","signatures":[{"sig":"MEUCIB69GD+pd1/ywkHGF01d6ucblUGtSK4Jq2iRaQ6Ps6WxAiEA9gxZMrfrQl5Wql8Y/uXIaGEsUKJ2YcSaaDSkTrN/mlo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10415},"main":"./src/index.ts","type":"module","types":"./src/index.ts","exports":{".":"./src/index.ts"},"scripts":{},"_npmUser":{"name":"benjos","email":"benjamin.schinkel01@outlook.fr"},"repository":{"url":"git+https://github.com/LeBenjos/spices.git","type":"git"},"_npmVersion":"11.6.2","description":"Collection of TypeScript common constant files for personal projects","directories":{},"_nodeVersion":"25.2.1","_hasShrinkwrap":false,"peerDependencies":{"typescript":">=5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/spices_1.0.0_1766877567064_0.0655212136601584","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@benjos/spices","version":"1.0.1","keywords":["constants","typescript"],"author":{"name":"benjos"},"license":"ISC","_id":"@benjos/spices@1.0.1","maintainers":[{"name":"benjos","email":"benjamin.schinkel01@outlook.fr"}],"homepage":"https://github.com/LeBenjos/spices#readme","bugs":{"url":"https://github.com/LeBenjos/spices/issues"},"dist":{"shasum":"d6866d73d3c0780d9559c369f795692995e1f752","tarball":"https://registry.npmjs.org/@benjos/spices/-/spices-1.0.1.tgz","fileCount":5,"integrity":"sha512-vAdmCm5xmoG9iaS4S4hHe7eyQTeKOkWIUa6RaXzk3SUW12G5hecgnPnSeBT1CWdR5hk2E0cgNAvvwG45ctpyrQ==","signatures":[{"sig":"MEYCIQDxVRc50Ed2Vw2Aiwb4uhcGROSEpQwc1Jr3jZNI8KaRzAIhANS+S07xDIsrjbykuAeRK/Wylf0axDknlmPoyPbTnQDB","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10695},"main":"./src/index.ts","type":"module","types":"./src/index.ts","exports":{".":"./src/index.ts"},"gitHead":"a48b97a7a6003def1217d8fdef0349efb5317544","scripts":{},"_npmUser":{"name":"benjos","email":"benjamin.schinkel01@outlook.fr"},"repository":{"url":"git+https://github.com/LeBenjos/spices.git","type":"git"},"_npmVersion":"11.6.2","description":"Collection of TypeScript common constant files for personal projects","directories":{},"_nodeVersion":"25.2.1","_hasShrinkwrap":false,"peerDependencies":{"typescript":">=5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/spices_1.0.1_1766879859670_0.6491232130873767","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@benjos/spices","version":"2.0.0","keywords":["constants","typescript"],"author":{"name":"benjos"},"license":"ISC","_id":"@benjos/spices@2.0.0","maintainers":[{"name":"benjos","email":"benjamin.schinkel01@outlook.fr"}],"homepage":"https://github.com/LeBenjos/spices#readme","bugs":{"url":"https://github.com/LeBenjos/spices/issues"},"dist":{"shasum":"9286ac0ecb43e0e3498aef7f30ebf5a79cfd6a09","tarball":"https://registry.npmjs.org/@benjos/spices/-/spices-2.0.0.tgz","fileCount":19,"integrity":"sha512-o91mgECXFKalcfUoSCSD9+iOELaK0kclTmCLwBFDHfhwVy54dp6gzSrtP/F0wAvVDvgQHiA7JLCwtF3HRgPj/Q==","signatures":[{"sig":"MEUCIGPKom8qvvbNjjFJoY4Wz/o6iNwHdguY2Ob/LzXJfEsGAiEAvzQ3zW14VEDmO1ltE0ldxSQ7Q9XDrWybbW5ymaB+SpI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39403},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"0bae7a3266ec795035a588d95b564edf59a711bc","scripts":{"build":"rm -rf dist && tsc","prepack":"npm run build"},"_npmUser":{"name":"benjos","email":"benjamin.schinkel01@outlook.fr"},"repository":{"url":"git+https://github.com/LeBenjos/spices.git","type":"git"},"_npmVersion":"11.17.0","description":"Collection of TypeScript common constant files for personal projects","directories":{},"sideEffects":false,"_nodeVersion":"26.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2"},"_npmOperationalInternal":{"tmp":"tmp/spices_2.0.0_1785522411598_0.37097867106361404","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"_id":"@benjos/spices@2.0.1","bugs":{"url":"https://github.com/LeBenjos/spices/issues"},"dist":{"shasum":"fa4059f1ef650f063d666bfa2218950e98ec9f28","tarball":"https://registry.npmjs.org/@benjos/spices/-/spices-2.0.1.tgz","fileCount":19,"integrity":"sha512-SqCaRIJXSe+Gt3E9vOPVuQq6a3cyBTfMiJucUhKyK//d6MUcYl7mBIu7qnclfpp71HuktWYsxfoO9lRhf8iPfQ==","signatures":[{"sig":"MEYCIQCPlgSR5FLH66YiCAQSgUJ14vmQ5kGmrK4TPBeb+4bSTwIhAL734HkDwAqjhhvScQO/iQiWUQSOxpR8Q37Maiigm9nk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBBdctNShG+mNhMEvM+lAAPiWBd6jjMoGCUQhtKCnLUpAiBBt4esET1t1j/zbRxNIblZhzbKSJzfjCrou7De2hSeZQ=="}],"unpackedSize":39750},"main":"./dist/index.js","name":"@benjos/spices","type":"module","types":"./dist/index.d.ts","author":{"name":"benjos"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"5ed6f86dddaf91a78a05e7917a822bc4de5801ff","license":"ISC","scripts":{"build":"rm -rf dist && tsc","prepack":"npm run build","typecheck":"tsc --noEmit","preversion":"npm run typecheck && (npm whoami || npm login)","postversion":"git push --follow-tags && npm publish","release:major":"npm version major","release:minor":"npm version minor","release:patch":"npm version patch","prepublishOnly":"npm run typecheck && npm run build"},"version":"2.0.1","_npmUser":{"name":"benjos","email":"benjamin.schinkel01@outlook.fr"},"homepage":"https://github.com/LeBenjos/spices#readme","keywords":["constants","typescript"],"repository":{"url":"git+https://github.com/LeBenjos/spices.git","type":"git"},"_npmVersion":"11.19.1","description":"Collection of TypeScript common constant files for personal projects","directories":{},"maintainers":[{"name":"benjos","email":"benjamin.schinkel01@outlook.fr"}],"sideEffects":false,"_nodeVersion":"26.8.2","_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/spices_2.0.1_1790065228878_0.8796468483356752"}}},"time":{"created":"2025-12-27T23:19:26.973Z","modified":"2026-09-22T08:20:29.181Z","1.0.0":"2025-12-27T23:19:27.225Z","1.0.1":"2025-12-27T23:57:39.831Z","2.0.0":"2026-07-31T18:26:51.733Z","2.0.1":"2026-09-22T08:20:28.982Z"},"bugs":{"url":"https://github.com/LeBenjos/spices/issues"},"author":{"name":"benjos"},"license":"ISC","homepage":"https://github.com/LeBenjos/spices#readme","keywords":["constants","typescript"],"repository":{"url":"git+https://github.com/LeBenjos/spices.git","type":"git"},"description":"Collection of TypeScript common constant files for personal projects","maintainers":[{"name":"benjos","email":"benjamin.schinkel01@outlook.fr"}],"readme":"# @benjos/spices\n\nCollection of TypeScript common constant files for personal projects.\n\nESM-only. Ships compiled JavaScript with type declarations — works in plain JS projects too, TypeScript is optional.\n\n## Installation\n\n```bash\nnpm install @benjos/spices\n```\n\n## Usage\n\n```ts\nimport { DomEvent, KeyboardKey, KeyboardCode } from '@benjos/spices';\n\nwindow.addEventListener(DomEvent.KEY_DOWN, (event) => {\n    if (event.key === KeyboardKey.ESCAPE) {\n        closeModal();\n    }\n    // Physical key position, independent of keyboard layout:\n    if (event.code === KeyboardCode.KEY_W) {\n        moveForward();\n    }\n});\n```\n\nEach constant is also exported as the string-literal union of its values:\n\n```ts\nimport type { DomEvent, KeyboardKey, KeyboardCode } from '@benjos/spices';\n\nfunction on(event: DomEvent, handler: EventListener): void { /* ... */ }\nconst shortcut: KeyboardKey = 'Escape';\n```\n\n## Available Constants\n\n### DomEvent\n\nDOM event names: mouse, pointer, touch, keyboard, focus, form, document,\nwindow, clipboard, drag & drop, media, animation, and transition events.\n\n### KeyboardKey\n\nValues of `KeyboardEvent.key` (layout-dependent, US-QWERTY for punctuation):\n\n- Letters: `A`–`Z` hold the unshifted value (`KeyboardKey.A === 'a'`);\n  `UPPER_A`–`UPPER_Z` hold the Shift/CapsLock value (`'A'`)\n- Digits: `DIGIT_0`–`DIGIT_9`, and their shifted symbols (`EXCLAMATION_MARK`, `AT`, ...)\n- Navigation: `ARROW_UP`, `ARROW_DOWN`, `ARROW_LEFT`, `ARROW_RIGHT`, `HOME`, `END`, ...\n- Special: `ENTER`, `ESCAPE`, `TAB`, `BACKSPACE`, `SPACE`, ...\n- Modifiers: `SHIFT`, `CONTROL`, `ALT`, `META`\n- Function keys: `F1`–`F12`\n\n### KeyboardCode\n\nValues of `KeyboardEvent.code` — physical key positions, layout-independent:\n`KEY_A`–`KEY_Z`, `DIGIT_0`–`DIGIT_9`, `NUMPAD_0`–`NUMPAD_9` and numpad operators,\nleft/right modifier variants (`SHIFT_LEFT`, `META_RIGHT`, ...), `F1`–`F12`, punctuation.\n\n## Migrating from 1.x\n\n| 1.x | 2.0 |\n| --- | --- |\n| `KeyboardConstant.KEYS.*` | `KeyboardKey.*` |\n| `KeyboardConstant.CODES.*` | `KeyboardCode.*` |\n| `KeyboardConstant.KEYS.A` (`'A'`) | `KeyboardKey.UPPER_A` |\n| `KeyboardConstant.KEYS.LOWER_A` (`'a'`) | `KeyboardKey.A` |\n| `KeyboardConstant.KEYS.QUOTE_2` | `KeyboardKey.DOUBLE_QUOTE` |\n| `KeyboardConstant.KEYS.OPEN_BRACE` / `CLOSE_BRACE` | `KeyboardKey.BRACE_LEFT` / `BRACE_RIGHT` |\n| `KeyboardConstant.KEYS.EXCLAMATION` | `KeyboardKey.EXCLAMATION_MARK` |\n| `KeyboardConstant.KEYS.SHARP` | `KeyboardKey.HASH` |\n| `DomEvent.MOUSE_WHEEL` | `DomEvent.WHEEL` |\n| `DomEvent.KEY_PRESS` (deprecated event) | removed — use `DomEvent.KEY_DOWN` |\n| `DomEvent.UNLOAD` (deprecated event) | removed — use `DomEvent.PAGE_HIDE` or `DomEvent.VISIBILITY_CHANGE` |\n| `DomEventType` | removed — use the `DomEvent` type (same string union) |\n| `KeyboardConstantType` | removed — it was the union of the `KEYS`/`CODES` object shapes, not of key strings; use the `KeyboardKey` / `KeyboardCode` types instead |\n\n## License\n\nISC\n","readmeFilename":"README.md"}