{"id":37088779,"url":"https://github.com/natethegreatt/bitecs","last_synced_at":"2026-01-14T10:54:03.526Z","repository":{"id":37232939,"uuid":"252572653","full_name":"NateTheGreatt/bitECS","owner":"NateTheGreatt","description":" Flexible, minimal, data-oriented ECS library for Typescript","archived":false,"fork":false,"pushed_at":"2025-08-25T15:09:23.000Z","size":4185,"stargazers_count":1177,"open_issues_count":11,"forks_count":99,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-10-29T22:46:10.472Z","etag":null,"topics":["ecs","entitycomponentsystem","functional","game","game-development","game-engine","gamedev","high-performance","particles"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NateTheGreatt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"NateTheGreatt"}},"created_at":"2020-04-02T21:53:05.000Z","updated_at":"2025-10-29T15:29:51.000Z","dependencies_parsed_at":"2023-02-10T12:45:29.496Z","dependency_job_id":"65d75a09-5899-4808-abea-011a9c4c5d15","html_url":"https://github.com/NateTheGreatt/bitECS","commit_stats":{"total_commits":350,"total_committers":24,"mean_commits":"14.583333333333334","dds":"0.49142857142857144","last_synced_commit":"ec8726143806aa4423ce9d4cc601e0fdd8b97030"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/NateTheGreatt/bitECS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateTheGreatt%2FbitECS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateTheGreatt%2FbitECS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateTheGreatt%2FbitECS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateTheGreatt%2FbitECS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NateTheGreatt","download_url":"https://codeload.github.com/NateTheGreatt/bitECS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateTheGreatt%2FbitECS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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","entitycomponentsystem","functional","game","game-development","game-engine","gamedev","high-performance","particles"],"created_at":"2026-01-14T10:54:02.779Z","updated_at":"2026-01-14T10:54:03.513Z","avatar_url":"https://github.com/NateTheGreatt.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003e\n❤ ❤ ❤ \u003cbr /\u003e\nbitECS\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/bitecs\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/bitecs.svg\" alt=\"Version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/bitecs\"\u003e\n    \u003cimg src=\"https://badgen.net/bundlephobia/minzip/bitecs\" alt=\"Minzipped\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/bitecs\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dt/bitecs.svg\" alt=\"Downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/NateTheGreatt/bitECS/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://badgen.net/npm/license/bitecs\" alt=\"License\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/daUxSk5AwX\"\u003e\n    \u003cimg src=\"https://img.shields.io/discord/1212857060731912202?color=7289da\u0026label=Discord\u0026logo=discord\u0026logoColor=white\" alt=\"Discord\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nFlexible, minimal, \u003ca href=\"https://www.dataorienteddesign.com/dodbook/\"\u003edata-oriented\u003c/a\u003e \u003ca href=\"https://en.wikipedia.org/wiki/Entity_component_system\"\u003eECS\u003c/a\u003e library for Typescript.\n\u003c/p\u003e\n\n\u003c/center\u003e\n\n## ✨ Features\n\n`bitECS` is a minimal, less opinionated, and powerful Entity Component System (ECS) library. It provides a lean API that enables developers to build their architecture to their liking, offering flexibility while maintaining efficiency where needed. Features include:\n| | |\n|---|---|\n| 🔮 Simple, declarative API | 🍃 Lightweight (`~5kb` minzipped) |\n| 🔍 Powerful querying | 📦 Zero dependencies |\n| 🔗 Relational entity modeling | 🧵 Thread-friendly |\n| 💾 Serialization included | 💖 Made with love |\n\n## 💿 Install\n```\nnpm i bitecs\n```\n\n## 📘  Documentation\n|                  |\n| ---------------- |\n| 🏁  [Introduction](/docs/Intro.md) |\n| 💾  [Serialization](/docs/Serialization.md) |\n| 🧵  [Multithreading](/docs/Multithreading.md) |\n| 📑  [API Docs](/docs/API.md) |\n\n## 🕹 Example\n\n```typescript\nimport {\n  createWorld,\n  query,\n  addEntity,\n  removeEntity,\n  addComponent,\n} from 'bitecs'\n\n// Put components wherever you want\nconst Health = [] as number[]\n\nconst world = createWorld({\n  components: {\n    // They can be any shape you want\n    // SoA:\n    Position: { x: [], y: [] },\n    Velocity: { x: new Float32Array(1e5), y: new Float32Array(1e5) },\n    // AoS:\n    Player: [] as { level: number; experience: number; name: string }[]\n  },\n  time: {\n    delta: 0, \n    elapsed: 0, \n    then: performance.now()\n  }\n})\n\nconst { Position, Velocity, Player } = world.components\n\nconst eid = addEntity(world)\naddComponent(world, eid, Position)\naddComponent(world, eid, Velocity)\naddComponent(world, eid, Player)\naddComponent(world, eid, Health)\n\n// SoA access pattern\nPosition.x[eid] = 0\nPosition.y[eid] = 0\nVelocity.x[eid] = 1.23\nVelocity.y[eid] = 1.23\nHealth[eid] = 100\n\n// AoS access pattern  \nPlayer[eid] = { level: 1, experience: 0, name: \"Hero\" }\n\nconst movementSystem = (world) =\u003e {\n  const { Position, Velocity } = world.components\n  \n  for (const eid of query(world, [Position, Velocity])) {\n    Position.x[eid] += Velocity.x[eid] * world.time.delta\n    Position.y[eid] += Velocity.y[eid] * world.time.delta\n  }\n}\n\nconst experienceSystem = (world) =\u003e {\n  const { Player } = world.components\n  \n  for (const eid of query(world, [Player])) {\n    Player[eid].experience += world.time.delta / 1000\n    if (Player[eid].experience \u003e= 100) {\n      Player[eid].level++\n      Player[eid].experience = 0\n    }\n  }\n}\n\nconst healthSystem = (world) =\u003e {\n  for (const eid of query(world, [Health])) {\n    if (Health[eid] \u003c= 0) removeEntity(world, eid)\n  }\n}\n\nconst timeSystem = (world) =\u003e {\n  const { time } = world\n  const now = performance.now()\n  const delta = now - time.then\n  time.delta = delta\n  time.elapsed += delta\n  time.then = now\n}\n\nconst update = (world) =\u003e {\n  timeSystem(world)\n  movementSystem(world)\n  experienceSystem(world)\n  healthSystem(world)\n}\n\n// Node environment\nsetInterval(() =\u003e {\n  update(world)\n}, 1000/60)\n\n// Browser environment\nrequestAnimationFrame(function animate() {\n  update(world)\n  requestAnimationFrame(animate)\n})\n```\n\n## 🔌 Used by\n\n- [Enchantment Engine](https://github.com/EnchantmentEngine/EnchantmentEngine)\n- [Third Room](https://github.com/thirdroom/thirdroom)\n- [Hubs](https://github.com/Hubs-Foundation/hubs)\n\n## 🌟 Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=NateTheGreatt/bitECS\u0026type=Date)](https://star-history.com/#NateTheGreatt/bitECS\u0026Date)\n","funding_links":["https://github.com/sponsors/NateTheGreatt"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatethegreatt%2Fbitecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatethegreatt%2Fbitecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatethegreatt%2Fbitecs/lists"}