{"_id":"cheet.js","_rev":"11-4fa43da9c452fae4dd23411da08bab9a","name":"cheet.js","description":"easy easter eggs (konami code, etc) for your site","dist-tags":{"latest":"0.3.3"},"versions":{"0.3.1":{"name":"cheet.js","version":"0.3.1","description":"easy easter eggs (konami code, etc) for your site","repository":{"type":"git","url":"https://github.com/namuol/cheet.js"},"keywords":["cheet","cheat","easter","eggs","keyboard","silly"],"license":"MIT","scripts":{"test":"grunt test","test.open":"grunt test.open"},"devDependencies":{"chai":"^1.9.1","grunt":"^0.4.5","grunt-contrib-connect":"0.7.1","grunt-contrib-jshint":"^0.10.0","grunt-contrib-uglify":"^0.4.0","grunt-mocha-phantomjs":"^0.5.0","mocha-phantomjs":"^3.4.1","phantomjs":"~1.9.2-4"},"bugs":{"url":"https://github.com/namuol/cheet.js/issues"},"homepage":"https://github.com/namuol/cheet.js","_id":"cheet.js@0.3.1","dist":{"shasum":"e7facbd4250be84cef7651038b5b0c1f7d3fed57","tarball":"https://registry.npmjs.org/cheet.js/-/cheet.js-0.3.1.tgz","integrity":"sha512-dcpmCYkJWnfXCqOqwtI7e7mdH18VcbLtVXAU6UhLm3pbvyRBZusUcNsc+b1EugJ+xZlkn0hkbmOP1AaSC25g3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGjlQro+c9H4KInK14H3jbHRIx18jFYBhtaj8H9cQdlEAiEAw69/045CdJsu+g06gjN7IQX4XRhDNbpZ4bI9cSE51Jg="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"namuol","email":"louis.acresti@gmail.com"},"maintainers":[{"name":"namuol","email":"louis.acresti@gmail.com"}]},"0.3.2":{"name":"cheet.js","version":"0.3.2","description":"easy easter eggs (konami code, etc) for your site","repository":{"type":"git","url":"https://github.com/namuol/cheet.js"},"main":"cheet","keywords":["cheet","cheat","easter","eggs","keyboard","silly"],"license":"MIT","scripts":{"test":"grunt test","test.open":"grunt test.open"},"devDependencies":{"chai":"^1.9.1","grunt":"^0.4.5","grunt-contrib-connect":"0.7.1","grunt-contrib-jshint":"^0.10.0","grunt-contrib-uglify":"^0.4.0","grunt-mocha-phantomjs":"^0.5.0","mocha-phantomjs":"^3.4.1","phantomjs":"~1.9.2-4"},"bugs":{"url":"https://github.com/namuol/cheet.js/issues"},"homepage":"https://github.com/namuol/cheet.js","_id":"cheet.js@0.3.2","dist":{"shasum":"f4122c28ad1142e503bd7103c8313b6c279763a9","tarball":"https://registry.npmjs.org/cheet.js/-/cheet.js-0.3.2.tgz","integrity":"sha512-oEseXuJ5tRM6TJllV3CkR7CcnZYnVnZCxQjKw9o0c6j4OrThdcurac7AZhRaHyOxDqgg+lxiBb351IkKVzFjZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDlcKq3PMbSAC+KbnhBnpiWS8EVRSD3u77raaHTbEN9wIhAJ8L3lUrlF4QzmA9K7EIhwRh2I5upb5OwixWP1QV3Cf9"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"namuol","email":"louis.acresti@gmail.com"},"maintainers":[{"name":"namuol","email":"louis.acresti@gmail.com"}]},"0.3.3":{"name":"cheet.js","version":"0.3.3","description":"easy easter eggs (konami code, etc) for your site","repository":{"type":"git","url":"https://github.com/namuol/cheet.js"},"main":"cheet","keywords":["cheet","cheat","easter","eggs","keyboard","silly"],"license":"MIT","scripts":{"test":"grunt test","test.open":"grunt test.open"},"devDependencies":{"chai":"^1.9.1","grunt":"^0.4.5","grunt-contrib-connect":"^0.9.0","grunt-contrib-jshint":"^0.10.0","grunt-contrib-uglify":"^0.6.0","grunt-mocha-phantomjs":"^0.6.0","mocha-phantomjs":"^3.4.1","phantomjs":"~1.9.2-4"},"gitHead":"b9498b01b942a8d15e7e17b498c9717be629f865","bugs":{"url":"https://github.com/namuol/cheet.js/issues"},"homepage":"https://github.com/namuol/cheet.js","_id":"cheet.js@0.3.3","_shasum":"c98e5fdefc8c6241a1cd6dcf71a09b063887daed","_from":".","_npmVersion":"1.4.20","_npmUser":{"name":"namuol","email":"louis.acresti@gmail.com"},"maintainers":[{"name":"namuol","email":"louis.acresti@gmail.com"}],"dist":{"shasum":"c98e5fdefc8c6241a1cd6dcf71a09b063887daed","tarball":"https://registry.npmjs.org/cheet.js/-/cheet.js-0.3.3.tgz","integrity":"sha512-Kdr9bZZMCR/RuzfIwKb4luTooXoLhROEEI1o7kdpUuHu5TwrmmVdJUkj0dswlK92VHw/PVDMbQXn92+Dd77jxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCx2Jyhl9KqEfSgxfpqHjTPgoaGhtw7PF1wEKG9SPaBrgIgIfQEtI/RCG80uph7mnLjjqp4A5Gs6AiA9FYJOoStaM0="}]}}},"readme":"# cheet.js [![Build Status](https://drone.io/github.com/namuol/cheet.js/status.png)](https://drone.io/github.com/namuol/cheet.js/latest) [![devDependency Status](https://david-dm.org/namuol/cheet.js/dev-status.svg)](https://david-dm.org/namuol/cheet.js#info=devDependencies)\n\n## easy easter eggs in the browser\n\n```javascript\ncheet('↑ ↑ ↓ ↓ ← → ← → b a', function () { alert('Voilà!'); });\n```\n\n```javascript\ncheet('i d d q d', function () {\n  alert('god mode enabled');\n});\n```\n\n```javascript\ncheet('o n e a t a t i m e', {\n  next: function (str, key, num, seq) {\n    console.log('key pressed: ' + key);\n    console.log('progress: ' + num / seq.length);\n    console.log('seq: ' + seq.join(' '));\n  },\n\n  fail: function () {\n    console.log('sequence failed');\n  },\n\n  done: function () {\n    console.log('+30 lives ;)');\n  }\n});\n```\n\n```javascript\ncheet('o n c e', function () {\n  console.log('This will only fire once.');\n  cheet.disable('o n c e');\n});\n```\n\n```javascript\nvar sequences = {\n  cross: 'up down left right',\n  circle: 'left up right down'\n};\n\ncheet(sequences.cross);\ncheet(sequences.circle);\n\ncheet.done(function (seq) {\n  if (seq === sequences.cross) {\n    console.log('cross!');\n  } else {\n    console.log('circle!');\n  }\n});\n```\n\n### Demo\n\n[My personal site](http://namuol.github.io) uses cheet.js (Try the [Konami Code](http://en.wikipedia.org/wiki/Konami_Code))\n\n### Install\n\n#### bower\n\n    bower install cheet.js\n\n    <script src=\"/bower_components/cheet.js/cheet.js\" type=\"text/javascript\"></script>\n\n#### component\n\n    component install namuol/cheet.js\n\n    <script src=\"/components/namuol-cheet.js/cheet.js\" type=\"text/javascript\"></script>\n\n### API\n\n<a name='api_cheet'></a>\n#### [`cheet(sequence, done | {next,fail,done})`](#api_cheet)\n\nMap a sequence of keypresses to a callback. This can be called multiple times.\n\n> <a name='api_cheet_sequence'></a>\n> [`sequence`](#api_cheet_sequence) (String)\n> > A string representation of a sequence of [key names](#available-key-names).\n> > \n> > Each keyname must be separated by a single space.\n> \n> <a name='api_cheet_done'></a>\n> [`done(str, seq)`](#api_cheet_done) (callback)\n> > A callback to execute each time the sequence is correctly pressed.\n> > \n> > Arguments:\n> > * `str` - The string representation of the sequence that completed.\n> > * `seq` - An array of [key names](#available-key-names) representing the sequence that completed.\n> \n> <a name='api_cheet_fail'></a>\n> [`fail(str, seq)`](#api_cheet_fail) (callback)\n> > A callback to execute each time a sequence's progress is broken.\n> > \n> > Arguments:\n> > * `str` - The string representation of the sequence that failed.\n> > * `seq` - An array of [key names](#available-key-names) representing the sequence that was pressed.\n>\n> <a name='api_cheet_next'></a>\n> [`next(str, key, num, seq)`](#api_cheet_next) (callback)\n> > A callback to execute each time a correct key in the sequence is pressed *in order*.\n> > \n> > Arguments:\n> > * `str` - The string representation of the sequence that is in progress.\n> > * `key` - The [name of the key](#available-key-names) that was just pressed.\n> > * `num` - A number representing the current progress of the sequence. (starts at 0)\n> > * `seq` - An array of [key names](#available-key-names) representing the sequence that is in progress.\n\n<a name='api_done'></a>\n#### [`cheet.done(callback)`](#api_done)\n\nSet a global callback that executes whenever *any* mapped sequence is completed successfully.\n\n> <a name='api_done_callback'></a>\n> [`callback(str, seq)`](#api_done_callback) (callback)\n> > A callback to execute each time *any* sequence is correctly pressed.\n> > \n> > Arguments:\n> > * `str` - The string representation of the sequence that completed.\n> > * `seq` - An array of [key names](#available-key-names) representing the sequence that completed.\n\n<a name='api_next'></a>\n#### [`cheet.next(callback)`](#api_next)\n\nSet a global callback that executes whenever *any* mapped sequence progresses.\n\n> <a name='api_next_callback'></a>\n> [`callback(str, key, num, seq)`](#api_next_callback) (callback)\n> > A callback to execute each time a correct key in any sequence is pressed *in order*.\n> > \n> > Arguments:\n> > * `str` - The string representation of the sequence that is in progress.\n> > * `key` - The [name of the key](#available-key-names) that was just pressed.\n> > * `num` - A number representing the current progress of the sequence. (starts at 0)\n> > * `seq` - An array of [key names](#available-key-names) representing the sequence that is in progress.\n\n<a name='api_fail'></a>\n#### [`cheet.fail(callback)`](#api_fail)\n\nSet a global callback that executes whenever *any* in-progress sequence is broken.\n\n> <a name='api_fail_callback'></a>\n> [`callback(str, seq)`](#api_fail_callback) (callback)\n> > A callback to execute each time *any* sequence's progress is broken.\n> > \n> > Arguments:\n> > * `str` - The string representation of the sequence that failed.\n> > * `seq` - An array of [key names](#available-key-names) representing the sequence that was pressed.\n\n<a name='api_disable'></a>\n#### [`cheet.disable(sequence)`](#api_disable)\n\nDisable a previously-mapped sequence.\n\n> <a name='api_disable_sequence'></a>\n> [`sequence`](#api_disable_sequence) (String)\n> > The same string you used to map the callback when using [`cheet(seq, ...)`](#api_cheet).\n\n<a name='api_reset'></a>\n#### [`cheet.reset(sequence)`](#api_reset)\n\nResets a sequence that may or may not be in progress.\n\nThis will *not* cause `fail` callbacks to fire, but will effectively\ncancel the sequence.\n\n> <a name='api_reset_sequence'></a>\n> [`sequence`](#api_reset_sequence) (String)\n> > The same string you used to map the callback when using [`cheet(seq, ...)`](#api_cheet).\n\n### Available Key Names\n\n**NOTE**: Key names are case-sensitive\n\n#### Directionals\n* `left` | `L` | `←`\n* `up` | `U` | `↑`\n* `right` | `R` | `→`\n* `down` | `D` | `↓`\n\n#### Alphanumeric\n* `0`-`9` (main number keys)\n* `a`-`z`\n\n#### Misc\n* `backspace`\n* `tab`\n* `enter` | `return`\n* `shift` | `⇧`\n* `control` | `ctrl` | `⌃`\n* `alt` | `option` | `⌥`\n* `command` | `⌘`\n* `pause`\n* `capslock`\n* `esc`\n* `space`\n* `pageup`\n* `pagedown`\n* `end`\n* `home`\n* `insert`\n* `delete`\n* `equal` | `=`\n* `comma` | `,`\n* `minus` | `-`\n* `period` | `.`\n\n#### Keypad\n* `kp_0`-`kp_9`\n* `kp_multiply`\n* `kp_plus`\n* `kp_minus`\n* `kp_decimal`\n* `kp_divide`\n\n#### Function keys\n* `f1`-`f12`\n\n### License\n\nMIT\n\n### Testing\n\nFrom the cheet.js' root directory:\n\n```shell\ngrunt test\n```\n\nYou can also run the tests directly in your browser:\n\n```shell\ngrunt test.open\n```\n\nOr just [view them online](http://namuol.github.io/cheet.js/tests).\n\n### Acknowledgements\n\nSpecial thanks to [Guilherme J. Tramontina](http://github.com/gtramontina) for writing the delicious [mocha](http://visionmedia.github.io/mocha/)/[chai](http://chaijs.com/) test suite.\n\n---\n\n`cheet.js` was just a fun little one-night project I made to put easter eggs on my personal site.\n\nIf you're looking for something more useful/serious, check out [Mousetrap](https://github.com/ccampbell/mousetrap).\n\n---\n\n[![Analytics](https://ga-beacon.appspot.com/UA-33247419-2/cheet.js/README.md)](https://github.com/igrigorik/ga-beacon)\n","maintainers":[{"name":"namuol","email":"louis.acresti@gmail.com"}],"time":{"modified":"2022-06-13T05:56:34.738Z","created":"2014-06-09T06:26:35.406Z","0.3.1":"2014-06-09T06:26:35.406Z","0.3.2":"2014-06-17T00:25:32.645Z","0.3.3":"2014-11-10T08:34:19.009Z"},"homepage":"https://github.com/namuol/cheet.js","keywords":["cheet","cheat","easter","eggs","keyboard","silly"],"repository":{"type":"git","url":"https://github.com/namuol/cheet.js"},"bugs":{"url":"https://github.com/namuol/cheet.js/issues"},"license":"MIT","readmeFilename":"README.md","users":{"zapo":true,"filipve":true,"adlerluiz":true}}