{"id":20694916,"url":"https://github.com/heedrox/readkey","last_synced_at":"2026-04-18T21:03:18.745Z","repository":{"id":57348693,"uuid":"163578699","full_name":"heedrox/readkey","owner":"heedrox","description":"A simple node key listener to read keys pressed on keyboard (based on a config object)","archived":false,"fork":false,"pushed_at":"2018-12-30T10:25:33.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T04:28:40.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/heedrox.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":"2018-12-30T10:21:52.000Z","updated_at":"2019-03-19T18:07:21.000Z","dependencies_parsed_at":"2022-08-31T18:03:05.030Z","dependency_job_id":null,"html_url":"https://github.com/heedrox/readkey","commit_stats":null,"previous_names":["jmarti-theinit/readkey"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/heedrox/readkey","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heedrox%2Freadkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heedrox%2Freadkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heedrox%2Freadkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heedrox%2Freadkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heedrox","download_url":"https://codeload.github.com/heedrox/readkey/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heedrox%2Freadkey/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31984558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"ssl_error","status_checked_at":"2026-04-18T20:23:29.375Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-17T00:07:16.699Z","updated_at":"2026-04-18T21:03:18.724Z","avatar_url":"https://github.com/heedrox.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# readkey\n\nA simple node key listener to read keys pressed on keyboard.\n\n# Usage\n\nCreate a config object with:\n- fn: the function that evaluates if the key has been pressed.\n- command: the command executed if fn() returns true\n\nSend it to readkey();\n\n```\nconst readkey = require('readkey');\nconst keyCommands = [\n  { fn: (str, key) =\u003e str === 'p', command: () =\u003e console.log('p was pressed') },\n  { fn: (str, key) =\u003e key.ctrl \u0026\u0026 key.name === 'c', command: () =\u003e process.exit() },\n  { fn: (str, key) =\u003e key.name === 'q', command: () =\u003e process.exit() },\n];\nreadkey(keyCommands);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheedrox%2Freadkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheedrox%2Freadkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheedrox%2Freadkey/lists"}