{"id":18711556,"url":"https://github.com/bitmap/use-konami-code","last_synced_at":"2025-07-19T23:10:08.877Z","repository":{"id":70856283,"uuid":"282738514","full_name":"bitmap/use-konami-code","owner":"bitmap","description":"Use the infamous Konami code with a React hook","archived":false,"fork":false,"pushed_at":"2020-07-28T01:27:34.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T16:52:34.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitmap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-26T21:45:53.000Z","updated_at":"2025-02-19T01:41:02.000Z","dependencies_parsed_at":"2023-07-14T21:15:10.936Z","dependency_job_id":null,"html_url":"https://github.com/bitmap/use-konami-code","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"75342a6f3a051c0e2a0a9e66c42528d5298743aa"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bitmap/use-konami-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitmap%2Fuse-konami-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitmap%2Fuse-konami-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitmap%2Fuse-konami-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitmap%2Fuse-konami-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitmap","download_url":"https://codeload.github.com/bitmap/use-konami-code/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitmap%2Fuse-konami-code/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266039012,"owners_count":23867815,"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":[],"created_at":"2024-11-07T12:39:27.159Z","updated_at":"2025-07-19T23:10:08.850Z","avatar_url":"https://github.com/bitmap.png","language":"TypeScript","readme":"# useKonamiCode\n\n⬆️⬆️⬇️⬇️⬅️➡️⬅️➡️🅱️🅰️\n\nUse the infamous Konami code with a React hook.\n\n## Install\n\n```sh\nnpm install @bitmap/use-konami-code\n```\n\n## Usage\n\nFor the uninitiated, [The Konami Code](https://en.wikipedia.org/wiki/Konami_Code) is one of the most well known video game cheat codes.\n\nThe sequence is `Up`, `Up`, `Down`, `Down`, `Left`, `Right`, `Left`, `Right`, `B`, `A`, `Enter`.\n\nAfter entering the code, the hook will run whatever callback function you pass to it.\n\n```js\nimport React, { useState } from 'react'\nimport { useKonamiCode } from '@bitmap/use-konami-code'\n\nfunction SecretComponent() {\n  const [cheatCodeActive, setCheatCodeActive] = useState(false)\n\n  useKonamiCode(() =\u003e {\n    setCheatCodeActive(true)\n  })\n\n  if (cheatCodeActive) return (\n    \u003cdiv\u003eIt’s a secret to everybody.\u003c/div\u003e\n  )\n\n  return null\n}\n```\n\n### Custom cheat code\n\n`useKonamiCode` takes a second argument, which is an array of `keycodeEvent.key` strings. This will allow you to to a custom key sequence.\n\n```js\nconst godMode = 'iddqd'.split('')\n\nuseKonamiCode(callback, godMode)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitmap%2Fuse-konami-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitmap%2Fuse-konami-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitmap%2Fuse-konami-code/lists"}