{"id":22356842,"url":"https://github.com/ayamflow/fps-control","last_synced_at":"2025-06-20T21:33:39.399Z","repository":{"id":21697027,"uuid":"93799854","full_name":"ayamflow/fps-control","owner":"ayamflow","description":"A naive FPS throttler implementation","archived":false,"fork":false,"pushed_at":"2022-05-03T16:51:19.000Z","size":2,"stargazers_count":16,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-23T19:48:40.779Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayamflow.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":"2017-06-08T23:26:35.000Z","updated_at":"2025-04-23T20:22:08.000Z","dependencies_parsed_at":"2022-07-24T23:02:07.835Z","dependency_job_id":null,"html_url":"https://github.com/ayamflow/fps-control","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ayamflow/fps-control","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayamflow%2Ffps-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayamflow%2Ffps-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayamflow%2Ffps-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayamflow%2Ffps-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayamflow","download_url":"https://codeload.github.com/ayamflow/fps-control/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayamflow%2Ffps-control/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261020451,"owners_count":23098152,"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-12-04T14:12:11.430Z","updated_at":"2025-06-20T21:33:34.387Z","avatar_url":"https://github.com/ayamflow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nfps-control\n===\n\n### A naive FPS throttler implementation\n\n\n### Installation :package:\n\n`npm i fps-control -S`\n\n### Usage \u0026 example :floppy_disk:\n\n```\n    import FPSControl from 'fps-control'\n\n    let fps = new FPSControl(30);\n\n    function update() {\n        if (!fps.check()) return;\n\n        // Drawn at 30FPS\n        ctx.drawImage(sprite.img, sprite.x, sprite.y);\n    }\n```\n\n* `new FPSControl(framerate)`\nReturns a new instance sync to a given `framerate` value\n\n* `instance.set(framerate)`\nSets `framerate` as the target framerate. Some examples values are 60 (no throttling), 30 (1/2 throttling).\n\n* `instance.check()`\nReturns `true` if the current frame matches the target framerate, `false` otherwise.\n\n### License :pencil:\nMIT.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayamflow%2Ffps-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayamflow%2Ffps-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayamflow%2Ffps-control/lists"}