konami.js
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/konami.js package

1.0.0 • Public • Published

konami.js

A small bit of JavaScript that recognizes the Konami code and triggers an event of your choice.

Usage

Step 1

Either load konami.js through a script tag or copy and paste the method in there to some place where you want it.

Step 2

Do something like this

konami(function () {
  alert('ding');
});

This will register a listener on all key(up) events, wait for the right sequence and then call the supplied function, in this case show 'ding' in an alert box.

Readme

Keywords

Package Sidebar

Install

npm i konami.js

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • grunka