{"id":21521075,"url":"https://github.com/weisjohn/nes-controller","last_synced_at":"2025-04-09T22:21:30.124Z","repository":{"id":17546713,"uuid":"20349501","full_name":"weisjohn/nes-controller","owner":"weisjohn","description":"Interface to a Gtron Nintendo Entertainment System USB controller or Tomee NES to USB adapter.","archived":false,"fork":false,"pushed_at":"2016-01-26T01:15:50.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T04:32:10.227Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/weisjohn.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":"2014-05-31T05:07:07.000Z","updated_at":"2024-06-22T02:57:32.000Z","dependencies_parsed_at":"2022-08-31T18:10:19.866Z","dependency_job_id":null,"html_url":"https://github.com/weisjohn/nes-controller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fnes-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fnes-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fnes-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fnes-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weisjohn","download_url":"https://codeload.github.com/weisjohn/nes-controller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248120162,"owners_count":21050903,"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-24T01:05:40.718Z","updated_at":"2025-04-09T22:21:30.099Z","avatar_url":"https://github.com/weisjohn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"nes-controller\n==============\n\nInterface to a\n[Gtron USB Nintendo Entertainment System controller](http://www.amazon.com/gp/product/B002YVD3KM) or [Tomee NES to USB adapter](http://www.amazon.com/gp/product/B00HM3QCN2).\nForked from [@dustMason](https://github.com/dustMason)'s [n64controller](https://github.com/dustMason/n64controller) module.\n\n`npm install nes-controller`\n\n### usage\n\n```\nvar controllers = require('nes-controller')();\nvar player1 = controllers[0];\n\nplayer1.on('pressA', function() {\n    console.log('A was pressed');\n});\n\nplayer1.on('releaseA', function() {\n    console.log('A was released');\n});\n```\n\nSee the [example.js](example.js) file for more detailed usage.\n\n### API\n\n - `pressA`\n - `releaseA`\n - `pressB`\n - `releaseB`\n - `pressSTART`\n - `releaseSTART`\n - `pressSELECT`\n - `releaseSELECT`\n - `analog`\n - `analogNS`\n - `analogEW`\n\n`analogNS` and `analogEW` receive one value, while `analog` receives an array of two values.\n\nThe directional values are either `0`, `127`, `255`.\n\n\n### others\n\nIf you have an NES USB Controller that isn't supported, pull requests are welcome.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweisjohn%2Fnes-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweisjohn%2Fnes-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweisjohn%2Fnes-controller/lists"}