{"id":20425998,"url":"https://github.com/seleb/input-gamepads.js","last_synced_at":"2026-01-31T07:04:11.818Z","repository":{"id":30494766,"uuid":"69789455","full_name":"seleb/input-gamepads.js","owner":"seleb","description":"wrapper for HTML5 Gamepad API","archived":false,"fork":false,"pushed_at":"2025-08-08T19:30:34.000Z","size":401,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-13T22:22:43.409Z","etag":null,"topics":["gamepad-api","javascript"],"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/seleb.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,"zenodo":null}},"created_at":"2016-10-02T09:38:39.000Z","updated_at":"2024-09-27T12:39:46.000Z","dependencies_parsed_at":"2025-05-11T19:32:21.186Z","dependency_job_id":null,"html_url":"https://github.com/seleb/input-gamepads.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/seleb/input-gamepads.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleb%2Finput-gamepads.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleb%2Finput-gamepads.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleb%2Finput-gamepads.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleb%2Finput-gamepads.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seleb","download_url":"https://codeload.github.com/seleb/input-gamepads.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seleb%2Finput-gamepads.js/sbom","scorecard":{"id":810374,"data":{"date":"2025-08-11","repo":{"name":"github.com/seleb/input-gamepads.js","commit":"2813d191082520a18f1855bd04ed73faa4d9cb45"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T13:00:21.730Z","repository_id":30494766,"created_at":"2025-08-23T13:00:21.730Z","updated_at":"2025-08-23T13:00:21.730Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28932605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T04:05:25.756Z","status":"ssl_error","status_checked_at":"2026-01-31T04:02:35.005Z","response_time":128,"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":["gamepad-api","javascript"],"created_at":"2024-11-15T07:14:55.925Z","updated_at":"2026-01-31T07:04:11.800Z","avatar_url":"https://github.com/seleb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inputs-gamepad.js\n\nWrapper for HTML5 Gamepad API. Not event-based.\n\nDeveloped and tested with an xbox360 wired controller on Chrome and Firefox.\n\n## How To\n\n### Browser\n\n1. include `./dist/index.iife.js` in HTML\n\n```html\n\u003cscript src=\"vendor/input-gamepads.js/dist/index.iife.js\"\u003e\u003c/script\u003e\n```\n\n2. reference global\n\n```js\nconst Gamepads = window.inputGamepads.Gamepads;\nconst Buttons = window.inputGamepads.Buttons;\nconst Axes = window.inputGamepads.Axes;\n```\n\n### Node\n\n1. install\n\n```sh\nnpm install input-gamepads.js --save\n```\n\n2. import\n\n```js\nconst { Gamepads, Buttons, Axes } = require(\"input-gamepads.js\");\n```\n\n```js\nimport { Gamepads, Buttons, Axes } from 'input-gamepads.js';\n```\n\n### Use\n\nLoop:\n\n```js\n// initialization\nconst gamepads = new Gamepads();\n\n// main loop\nfunction main(){\n  // get inputs\n  var button_is_currently_up = gamepads.isUp(Buttons.A);\n  var button_is_currently_down = gamepads.isDown(Buttons.X);\n  var button_is_currently_up_but_wasnt_last_frame = gamepads.isJustUp(Buttons.B);\n  var button_is_currently_down_but_wasnt_last_frame = gamepads.isJustDown(Buttons.Y);\n  var axis_value = gamepads.getAxis(Axes.LSTICK_H);\n  var axis_crossed_threshold_like_button = gamepads.axisPast(Axes.LSTICK_H, 0.5, 1);\n  var the_first_four_axis_values_as_a_4d_vector = gamepads.getAxes(0,4);\n  var dpad_as_a_2d_vector = gamepads.getDpad();\n  \n  // do your code\n  \n  // update gamepads (clears arrays, polls connections, etc.)\n  gamepads.update();\n}\n```\n\nAll input functions take `player` as an optional final argument. If `player` isn't provided, all controllers will contribute (i.e. a button will be considered down if any controller has them down, an axis will be considered as the sum of the axis on each controller).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseleb%2Finput-gamepads.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseleb%2Finput-gamepads.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseleb%2Finput-gamepads.js/lists"}