{"id":15297284,"url":"https://github.com/thiagogarbazza/key-code","last_synced_at":"2025-10-04T08:59:00.794Z","repository":{"id":58236070,"uuid":"64152288","full_name":"thiagogarbazza/key-code","owner":"thiagogarbazza","description":"Library for key-code constants in ECMAScript/Javascript","archived":false,"fork":false,"pushed_at":"2018-06-14T11:43:03.000Z","size":16,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T23:15:44.529Z","etag":null,"topics":["ecmascript","enumeration","javascript","keyboard-code","keyboard-key-code"],"latest_commit_sha":null,"homepage":null,"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/thiagogarbazza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-25T16:56:10.000Z","updated_at":"2019-10-02T15:05:27.000Z","dependencies_parsed_at":"2022-08-31T09:22:47.363Z","dependency_job_id":null,"html_url":"https://github.com/thiagogarbazza/key-code","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagogarbazza%2Fkey-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagogarbazza%2Fkey-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagogarbazza%2Fkey-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagogarbazza%2Fkey-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagogarbazza","download_url":"https://codeload.github.com/thiagogarbazza/key-code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794568,"owners_count":21162615,"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":["ecmascript","enumeration","javascript","keyboard-code","keyboard-key-code"],"created_at":"2024-09-30T19:16:22.134Z","updated_at":"2025-10-04T08:58:55.745Z","avatar_url":"https://github.com/thiagogarbazza.png","language":"JavaScript","readme":"# key-code\n[![Build Status](https://travis-ci.org/thiagogarbazza/key-code.svg?branch=master)](https://travis-ci.org/thiagogarbazza/key-code)\n[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/thiagogarbazza/key-code/)\n\n\nLibrary for key-code constants in ECMAScript/Javascript\n\nFor more information [see this](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#Constants_for_keyCode_value).\n\nSee [key-code.js](src/key-code.js)  for a full list of all the constants\n\n## Installation\n\n### Using NPM\n\n```sh\nnpm install --save key-code\n```\n\n### Using Bower\n\n```sh\nbower install --save key-code\n```\n\n## Usage\n\n### Using NodeJs\n\nInclude the package using CommonJS require()\n```js\nvar KeyCode = require('key-code');\n```\n\nor ES2015 import:\n```js\n// ES2015+\nimport KeyCode from 'key-code';\n```\n\n### Using Browser\n\n```html\n\u003c!-- Load files. --\u003e\n\u003cscript src=\"/path/to/key-code/dist/key-code.js\"\u003e\u003c/script\u003e\n\n\u003cinput type=\"text\" onkeydown=\"myFunction(event)\"\u003e\n```\n\n```js\nfunction myFunction(event) {\n    if (event.keyCode === KeyCode.ENTER) {\n        alert('keypress ENTER');\n    }\n}\n```\n\n### Using Browser via CDN - [jsdelivr](https://www.jsdelivr.com)\n\n```html\n\u003c!-- Load files. --\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/key-code@0.0.1/dist/key-code.js\"\u003e\u003c/script\u003e\n\n\u003cinput type=\"text\" onkeydown=\"myFunction(event)\"\u003e\n```\n\n```js\nfunction myFunction(event) {\n    if (event.keyCode === KeyCode.ENTER) {\n        alert('keypress ENTER');\n    }\n}\n```\n\n\n## License\n\nThe `key-code` project is under MIT license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagogarbazza%2Fkey-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagogarbazza%2Fkey-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagogarbazza%2Fkey-code/lists"}