bitECS
A flexible toolkit for data-oriented design in game development. Performance focused with zero dependencies.
bun add bitecsSimple, declarative API
Lightweight (~5kb)
Powerful querying
Zero dependencies
Relational modeling
Thread-friendly
Serialization included
Made with love
example.ts
import { createWorld, addEntity, addComponent, query } from 'bitecs'
const Position = { x: [] as number[], y: [] as number[] }
const Velocity = { x: [] as number[], y: [] as number[] }
const world = createWorld()
const eid = addEntity(world)
addComponent(world, eid, Position)
addComponent(world, eid, Velocity)
for (const entity of query(world, [Position, Velocity])) {
Position.x[entity] += Velocity.x[entity]
Position.y[entity] += Velocity.y[entity]
}