Skip to content

A simple JavaScript module that lets you pass a callback after a user has entered the Konami code.

License

Notifications You must be signed in to change notification settings

augbog/konami-komando

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Konami Komando

A simple JavaScript module that lets you pass a callback after a user has entered the Konami code.

Konami code

Install

npm install konami-komando --save-dev

Usage

require('konami-komando')({
  once: true,
  useCapture: true,
  callback: function() {
    // Do stuff here
  }
});

Parameters

once

Tells the code to only detect when a user has inputted the konami code once and then will no longer stop execution. If set to false, everytime the user inputs the konami code, the callback will be ran.

If not specified, it will default to true.

useCapture

Sets the priority of the event listener on keydown. This is important if you have your own event listeners on keydown. For more information on useCapture, check out this StackOverflow answer about it and also the MDN documentation.

If not specified, it will default to true.

callback

The action that should be ran after the konami code has been entered. If a function is not passed, it will throw an error.

About

A simple JavaScript module that lets you pass a callback after a user has entered the Konami code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published