KoCodeJS - A library for Konami Code
Copyright (c) 2019, Thanasis Vergoulis (firstname.lastname@example.org)
<script src="kocode.js"> </script>
And then start the listener like this:
<script> document.onkeyup = konami_code; </script>
The code is provided under a GNU/GPL license.