{"id":43042321,"url":"https://github.com/goldenratio/super-ecs","last_synced_at":"2026-01-31T09:15:39.152Z","repository":{"id":49864304,"uuid":"199198470","full_name":"goldenratio/super-ecs","owner":"goldenratio","description":"Super ECS - Entity Component System library for JavaScript/TypeScript games","archived":false,"fork":false,"pushed_at":"2025-12-13T14:39:35.000Z","size":881,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-15T07:12:23.055Z","etag":null,"topics":["ecs","entity-component","entity-component-system"],"latest_commit_sha":null,"homepage":"https://goldenratio.github.io/super-ecs/","language":"TypeScript","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/goldenratio.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["goldenratio"],"custom":["https://labrat.mobi/donate"]}},"created_at":"2019-07-27T18:06:49.000Z","updated_at":"2025-12-13T14:39:21.000Z","dependencies_parsed_at":"2025-01-28T06:31:07.037Z","dependency_job_id":"da8288ae-f26a-4bf1-b7f7-b99597b7561e","html_url":"https://github.com/goldenratio/super-ecs","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/goldenratio/super-ecs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldenratio%2Fsuper-ecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldenratio%2Fsuper-ecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldenratio%2Fsuper-ecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldenratio%2Fsuper-ecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goldenratio","download_url":"https://codeload.github.com/goldenratio/super-ecs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldenratio%2Fsuper-ecs/sbom","scorecard":{"id":434629,"data":{"date":"2025-08-11","repo":{"name":"github.com/goldenratio/super-ecs","commit":"2f63bbf9556eb70154e8077861daee9746f51d1d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/stale.yml:1","Warn: no topLevel permission defined: .github/workflows/validate-main-commit.yml:1","Warn: no topLevel permission defined: .github/workflows/validate-pr.yml:1","Info: no jobLevel write permissions found"],"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/goldenratio/super-ecs/stale.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/validate-main-commit.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/goldenratio/super-ecs/validate-main-commit.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/validate-pr.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/goldenratio/super-ecs/validate-pr.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/validate-main-commit.yml:17","Warn: npmCommand not pinned by hash: .github/workflows/validate-pr.yml:14","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned"],"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"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 'main'"],"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 4 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":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-19T04:17:28.409Z","repository_id":49864304,"created_at":"2025-08-19T04:17:28.409Z","updated_at":"2025-08-19T04:17:28.409Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28936100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T08:53:31.997Z","status":"ssl_error","status_checked_at":"2026-01-31T08:51:38.521Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["ecs","entity-component","entity-component-system"],"created_at":"2026-01-31T09:15:38.430Z","updated_at":"2026-01-31T09:15:39.144Z","avatar_url":"https://github.com/goldenratio.png","language":"TypeScript","funding_links":["https://github.com/sponsors/goldenratio","https://labrat.mobi/donate"],"categories":[],"sub_categories":[],"readme":"# super-ecs\nEntity Component System library for JavaScript/TypeScript games.\n\n\n- **API Docs:** https://goldenratio.github.io/super-ecs/\n- **Example Repo:** https://github.com/goldenratio/super-ecs-example\n- **Example Repo (Vanilla JS):** https://github.com/goldenratio/super-ecs-vanilla-js-example\n- **CDN:** https://unpkg.com/browse/super-ecs/dist/\n\n\u003e [!NOTE]\n\u003e **Status:** Feature Complete\n\n## Install\n\n### NPM\n\u003e npm install --save super-ecs\n\nhttps://www.npmjs.com/package/super-ecs\n\n## Basic Usage\nTo define a new component, simply implement `Component`.\nNote that each component should have a unique `name` property.\n\n```js\nconst COMPONENT_NAMES = {\n  Position: Symbol('Position'),\n  Velocity: Symbol('Velocity'),\n  Health: Symbol('Health')\n};\n\nclass Position {\n  name = COMPONENT_NAMES.Position;\n  constructor({ x = 0, y = 0 }) {\n    this.x = x;\n    this.y = y;\n  }\n}\n\nclass Velocity {\n  name = COMPONENT_NAMES.Velocity;\n  constructor({ x = 0, y = 0 }) {\n    this.x = x;\n    this.y = y;\n  }\n}\n\nclass Health {\n  name = COMPONENT_NAMES.Health;\n  constructor({ maxHealth = 100 }) {\n    this.health = maxHealth;\n    this.maxHealth = maxHealth;\n  }\n\n  isDead() {\n    return this.health \u003c= 0;\n  }\n\n  receiveDamage(damage) {\n    this.health -= damage;\n  }\n}\n```\n\nAn entity is essentially a container of one or more components.\n\n```js\nconst hero = new Entity();\nhero.addComponent(new Position({ x: 0, y: 0 }));\nhero.addComponent(new Velocity({ x: 0, y: 0 }));\nhero.addComponent(new Health({ maxHealth: 50 }));\n```\n\nThe system is responsible for updating the entities.\nIn a real game there may be a lot of systems, like `CollisionSystem`,\n`RenderSystem`, `ControlSystem` etc.\n\n```js\nclass PhysicSystem extends System {\n\n  update(delta) {\n\n   const entities = this.world.getEntities([COMPONENT_NAMES.Position, COMPONENT_NAMES.Velocity]);\n   entities.forEach(entity =\u003e {\n       const position = entity.getComponent(COMPONENT_NAMES.Position);\n       const velocity = entity.getComponent(COMPONENT_NAMES.Velocity);\n       if (position \u0026\u0026 velocity) {\n          position.x += velocity.x * delta;\n          position.y += velocity.y * delta;\n       }\n   });\n  }\n}\n```\n\nThe world is the container of all the entities and systems.\nCalling the `update` method will *sequentially* update all the systems,\nin the order they were added.\n\n```js\nconst world = new World();\n\nworld.addEntity(hero);\n// ... add other entities\n\nworld.addSystem(new PhysicSystem());\n// ... add other systems\n\nrequestAnimationFrame(function () {\n    world.update(/* interval */);\n})\n```\n\nA system is notified when it is added or removed from the world:\n\n```js\nclass MySystem extends System {\n\n  addedToWorld(world) {\n    super.addedToWorld(world);\n    // Code to handle being added to world. Remember to call `super`.\n  }\n\n  removedFromWorld(world) {\n      super.removedFromWorld(world);\n      // Code to handle being removed from world.. Remember to call `super`.\n    }\n}\n```\n\nThe world emits Observable when entities are added or removed. You can listen for\nspecific entities and handle the Observable accordingly:\n\n```js\nclass MySystem extends System {\n\n  removedFromWorld(world) {\n    super.removedFromWorld(world);\n    if (this._disposeBag) {\n      this._disposeBag.dispose();\n    }\n  }\n\n  addedToWorld(world) {\n    super.addedToWorld(world);\n    // Code to handle being added to world. Remember to call `super`.\n\n    this._disposeBag = new DisposeBag();\n\n    this._disposeBag.completable$(world.entityAdded$([COMPONENT_NAMES.Position, COMPONENT_NAMES.Velocity]))\n      .subscribe(entity =\u003e {\n        // This function is called whenever an entity with both 'position' and\n        // 'velocity' components is added to the world. It can also be called when\n        // a component is added to an entity; for example, when an entity with\n        // only 'position' has 'velocity' added to it.\n      });\n\n    this._disposeBag.completable$(world.entityRemoved$([COMPONENT_NAMES.Position, COMPONENT_NAMES.Velocity]))\n      .subscribe(entity =\u003e {\n        // This function is called whenever an entity with both 'position' and\n        // 'velocity' components is removed from the world. It can also be called\n        // when a component is removed from an entity; for example, when an entity\n        // with both 'position' and 'velocity' has 'velocity' removed from it.\n    });\n  }\n}\n```\n\n`DisposeBag` util is avialable [here](https://github.com/goldenratio/super-ecs-example/blob/main/src/utils/dispose-bag/dispose-bag.ts)\n\nPort of [CES.js](https://github.com/qiao/ces.js) with some changes,\n- instead of `signal`, we use `rxjs`\n- component names should be of type `symbol`\n\n## Release\n\n### NPM\n```console\nnpm version {major | minor | patch}\nnpm publish\n\n# If you have ignore-scripts enabled\nnpm version {major | minor | patch}\nnpm run version\nnpm run postversion\nnpm publish\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldenratio%2Fsuper-ecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoldenratio%2Fsuper-ecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldenratio%2Fsuper-ecs/lists"}