hesoyam
v0.1.2
Published
Old-school cheat codes for modern web apps
Readme
The library provides an engine for entering cheat codes in your web applications. For example, this is how you can hide some functionality without resorting to feature toggles or inject an easter egg.
- Framework agnostic.
- Zero dependencies
- Less then kilobyte (even without GZip)
How does it work?
Cheat codes are encoded into a special number so that they can be kept open source without fear of easy decryption. For example:
hesoyam— 117499400panzer— 100663304
When the listener is activated, the library records all keystrokes and calls a callback as soon as the buffer contains the necessary code.
Cheats are layout agnostic: they work regardless of the keyboard layout.
Installation
pnpm add hesoyamUsage
import { createCheatsListener } from 'hesoyam';
const HESOYAM = 0x0700E608;
const { start } = createCheatsListener({
onCheat: (code) => {
if (code === HESOYAM) {
console.log('Got hesoyam code', code);
}
},
cheats: [HESOYAM],
});
start();