Skip to content

konami

const konami: object

Defined in: index.ts:7

Konami code helpers.

CODE: TKonamiCode[]

The Konami code key sequence, as KeyboardEvent.code values.

is: (event) => boolean

Feeds a key event into the sequence and returns true when it completes the Konami code; a wrong key resets progress. The progress is module-level state shared by every caller, so use one listener per page.

KeyboardEvent

boolean

import { konami } from "@theholocron/misc-utils";
document.addEventListener("keydown", (event) => {
if (konami.is(event)) console.log("Konami Code entered!");
});