{"id":15393082,"url":"https://github.com/shgysk8zer0/konami","last_synced_at":"2025-04-15T23:33:16.811Z","repository":{"id":38357144,"uuid":"454595099","full_name":"shgysk8zer0/konami","owner":"shgysk8zer0","description":"A simple JavaScript module for adding Konami Code Easter Eggs","archived":false,"fork":false,"pushed_at":"2024-03-19T19:31:11.000Z","size":328,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-02T03:05:37.869Z","etag":null,"topics":["konami","konami-code","konami-js"],"latest_commit_sha":null,"homepage":"https://shgysk8zer0.github.io/konami/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shgysk8zer0.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"shgysk8zer0","liberapay":"shgysk8zer0"}},"created_at":"2022-02-02T00:17:12.000Z","updated_at":"2023-12-14T10:14:18.000Z","dependencies_parsed_at":"2023-02-10T04:01:11.283Z","dependency_job_id":"5cb1d24f-1ceb-448e-a722-dbb8e7199ff5","html_url":"https://github.com/shgysk8zer0/konami","commit_stats":{"total_commits":70,"total_committers":2,"mean_commits":35.0,"dds":0.5,"last_synced_commit":"467d091f8443d121ab2b0166ccd5c813c3364f1c"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":"shgysk8zer0/blank-repo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shgysk8zer0%2Fkonami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shgysk8zer0%2Fkonami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shgysk8zer0%2Fkonami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shgysk8zer0%2Fkonami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shgysk8zer0","download_url":"https://codeload.github.com/shgysk8zer0/konami/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240356060,"owners_count":19788512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["konami","konami-code","konami-js"],"created_at":"2024-10-01T15:17:48.624Z","updated_at":"2025-02-28T20:31:48.512Z","avatar_url":"https://github.com/shgysk8zer0.png","language":"JavaScript","funding_links":["https://github.com/sponsors/shgysk8zer0","https://liberapay.com/shgysk8zer0","https://liberapay.com/shgysk8zer0/donate"],"categories":[],"sub_categories":[],"readme":"# Konami Code JS module\n[![CodeQL](https://github.com/shgysk8zer0/konami/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/shgysk8zer0/konami/actions/workflows/codeql-analysis.yml)\n![Node CI](https://github.com/shgysk8zer0/konami/workflows/Node%20CI/badge.svg)\n![Lint Code Base](https://github.com/shgysk8zer0/konami/workflows/Lint%20Code%20Base/badge.svg)\n\n[![GitHub license](https://img.shields.io/github/license/shgysk8zer0/konami.svg)](https://github.com/shgysk8zer0/konami/blob/master/LICENSE)\n[![GitHub last commit](https://img.shields.io/github/last-commit/shgysk8zer0/konami.svg)](https://github.com/shgysk8zer0/konami/commits/master)\n[![GitHub release](https://img.shields.io/github/release/shgysk8zer0/konami?logo=github)](https://github.com/shgysk8zer0/konami/releases)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/shgysk8zer0?logo=github)](https://github.com/sponsors/shgysk8zer0)\n\n[![npm](https://img.shields.io/npm/v/@shgysk8zer0/konami)](https://www.npmjs.com/package/@shgysk8zer0/konami)\n![node-current](https://img.shields.io/node/v/@shgysk8zer0/konami)\n![npm bundle size gzipped](https://img.shields.io/bundlephobia/minzip/@shgysk8zer0/konami)\n[![npm](https://img.shields.io/npm/dw/@shgysk8zer0/konami?logo=npm)](https://www.npmjs.com/package/@shgysk8zer0/konami)\n\n[![GitHub followers](https://img.shields.io/github/followers/shgysk8zer0.svg?style=social)](https://github.com/shgysk8zer0)\n![GitHub forks](https://img.shields.io/github/forks/shgysk8zer0/konami.svg?style=social)\n![GitHub stars](https://img.shields.io/github/stars/shgysk8zer0/konami.svg?style=social)\n[![Twitter Follow](https://img.shields.io/twitter/follow/shgysk8zer0.svg?style=social)](https://twitter.com/shgysk8zer0)\n\n[![Donate using Liberapay](https://img.shields.io/liberapay/receives/shgysk8zer0.svg?logo=liberapay)](https://liberapay.com/shgysk8zer0/donate \"Donate using Liberapay\")\n\n![](https://shgysk8zer0.github.io/konami/konami.webp)\n\n\u003e The Konami Code (Japanese: コナミコマンド, Konami Komando, \"Konami command\"), also\n\u003e commonly referred to as the Contra Code and sometimes the 30 Lives code,\n\u003e is a cheat code that appears in many Konami video games, as well as some\n\u003e non-Konami games. In the original code, the player has to press the\n\u003e following sequence of buttons on the game controller to enable a cheat or other\n\u003e effects:\n\u003e\n\u003e `↑ ↑ ↓ ↓ ← → ← → B A`; sometimes Start and/or Select is added to the sequence\n\u003e (usually to start Single player or, Two player modes).\n\u003e ~[Konami Code | Wikipedia](https://en.wikipedia.org/wiki/Konami_Code)\n\n## Quick Links\n- [About](#about)\n- [Installation](#installation)\n- [Options](#options)\n- [Example](#example)\n- [Requirements](#requirements)\n- [Supported Browsers](#supported-browsers)\n- [@shgysk8zer0/konami on npm](https://www.npmjs.com/package/@shgysk8zer0/konami)\n- [@shgysk8zer0/konami on unpkg](https://unpkg.com/browse/@shgysk8zer0/konami/)\n- [Issues](https://github.com/shgysk8zer0/konami/issues)\n- [Contributing](./.github/CONTRIBUTING.md)\n- [Changelog](./CHANGELOG.md)\n\n### About\n`konami.js` enables developers to easily add the Konami Code to their websites.\nLike other JavaScript solutions, this one adds keyboard listeners and waits\nfor the specifc sequence of keys to be pressed. Unlike other solutions, however,\nthis one:\n- Is a [JavaScript module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)\nthat may be `import`ed\n- Returns a `Promise` that resolves when the correct sequence is entered and\nmay be `await`ed\n- Supports [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)\n- Allows specifying the `EventTarget` via the optional `{ target }`.\n\n### Installation\n#### npm\n\n```bash\nnpm i @shgysk8zer0/konami\n```\n\n#### Git Submodule\n```bash\ngit submodule add https://github.com/shgysk8zer0/konami.git js/konami\n```\n\n#### CDN (unpkg)\n```js\nconst { konami } = await import('https://unpkg.com/@shgysk8zer0/konami');\n```\n\n### Updating\n\n#### Git Submodule\n```bash\ngit submodule update --remote -- js/konami\n```\n\n**Tip**: Use [Dependabot](https://github.com/dependabot) to automatically get\nPull Requests when a submodule or package is updated.\n\n### Options\n\n```js\nimport { konami } from '/js/konami/konami.js';\n\nawait konami({ target, delay, signal, capture });\n```\n\n| Name      | Type          | Default Value | Description                             |\n------------|---------------|---------------|-----------------------------------------\n| `target`  | `EventTarget` | `globalThis`  | Target to listen for input on           |\n| `delay`   | `Number`      | `1000`        | Allowed delay in ms between inputs      |\n| `signal`  | `AbortSignal` | `undefined`   | See [`signal` on MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#parameters) |\n| `capture` | `Boolean`     | `true`        | See [`capture` on MDN](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#parameters) |\n\n### Example\n\n#### From Submodule\n```js\nimport { konami } from '/js/konami/konami.js';\n\nkonami().then(/* Enter Cheat Mode! */);\n```\n\n#### From npm\n```js\n\nimport { konami } from '@shgysk8zer0/konami';\n// or const { konami } = require('@shgysk8zer0/konami');\n\nkonami().then(/* Enter Cheat Mode! */);\n```\n\n### Advanced\n\n#### From unpkg CDN\n```js\nconst controller = new AbortController();\n// This will use version 1.0.5\nconst { konami } = await import('https://unpkg.com/@shgysk8zer0/konami@1.0.5/konami.js');\n\ntry {\n  await konami({\n    delay: 500,\n    target: document.getElementById('konami-target'),\n    signal: controller.signal,\n    capture: true,\n  });\n\n  /* Enter Cheat Mode! */\n} catch(err) {\n  // Signal was aborted\n}\n```\n\n### Requirements\nDue to use of `signal`, support is currently limited to browsers supporting\n`AbortSignal` \u0026 `AbortController`. Support may be extended to other browser by\nimporting a polyfill.\n\n### Supported Browsers\n\n| Browser           | Supported | Version | Released   |\n--------------------|-----------|---------|------------\n| Internet Explorer | 𐄂         |         |            |\n| Edge              | ✓         | 16      | 2017-10-16 |\n| Safari            | ✓         | 12.1    | 2019-03-24 |\n| Chrome            | ✓         | 66      | 2018-04-16 |\n| Firefox           | ✓         | 57      | 2017-11-13 |\n| Node              | ✓         | 15      | ?          |\n| Deno              | ✓         | 1.0     | ?          |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshgysk8zer0%2Fkonami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshgysk8zer0%2Fkonami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshgysk8zer0%2Fkonami/lists"}