{"id":36541337,"url":"https://github.com/ttse76/keypress-util","last_synced_at":"2026-01-12T05:47:08.962Z","repository":{"id":45482022,"uuid":"513673254","full_name":"ttse76/keypress-util","owner":"ttse76","description":"Utility to identify keycodes for keyboard keys","archived":false,"fork":false,"pushed_at":"2022-07-13T22:15:33.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-26T09:58:28.225Z","etag":null,"topics":["keyboard","keycode","keypress","keys","module","node","nodejs","react","utility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/keypress-util","language":"JavaScript","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/ttse76.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}},"created_at":"2022-07-13T21:15:07.000Z","updated_at":"2022-07-13T22:17:37.000Z","dependencies_parsed_at":"2022-07-15T07:47:42.907Z","dependency_job_id":null,"html_url":"https://github.com/ttse76/keypress-util","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ttse76/keypress-util","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttse76%2Fkeypress-util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttse76%2Fkeypress-util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttse76%2Fkeypress-util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttse76%2Fkeypress-util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttse76","download_url":"https://codeload.github.com/ttse76/keypress-util/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttse76%2Fkeypress-util/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["keyboard","keycode","keypress","keys","module","node","nodejs","react","utility"],"created_at":"2026-01-12T05:47:08.901Z","updated_at":"2026-01-12T05:47:08.957Z","avatar_url":"https://github.com/ttse76.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Keypress Util\n![test](https://github.com/ttse76/keypress-util/actions/workflows/node.js.yml/badge.svg)\n\nA lightweight module for getting keycodes\n\n## Installation\n`npm i keypress-util`\n\n## Usage\nTo find a key, import the `KEY_CODES` object, then find the key in the list of keys.\n```javascript\nconst { KEY_CODES } = require('keypress-util');\nconst code = KEY_CODES.SHIFT; // 16\n```\nTo get a key based on a code, import the `getKey` function. All keycodes are numbers, `getKey` returns `\"NONE\"` if the keycode is either not a number or an invalid key. Numbers as a string are valid as long as the number is a valid keycode.\n```javascript\nconst { getKey } = require('keypress-util');\n\nconst k0 = getKey(16); // \"SHIFT\"\nconst k1 = getKey('45') // \"INSERT\"\nconst k2 = getKey(500); // \"NONE\"\nconst k3 = getKey(\"Invalid Key\"); // \"NONE\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttse76%2Fkeypress-util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttse76%2Fkeypress-util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttse76%2Fkeypress-util/lists"}