npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ratprez/entm

v0.5.0

Published

ECS framework for FiveM - types, core classes, and shared component API

Readme

@ratprez/entm

npm version

TypeScript ECS (Entity Component System) framework package for FiveM. This is the base package - it provides the core classes, component types, and math utilities used by entm-core and any module built on top of it.

This package is a companion to entm-core. It is not a standalone FiveM resource. Install it as a dev dependency in your module projects.

Installation

npm install @ratprez/entm

Testing

The package includes a comprehensive test suite built with Vitest:

npm test

Coverage: 138 tests across 8 test files covering all core ECS functionality including ComponentPool, World, View, System, Vec3 math, Profiler, and integration scenarios.

What's included

Core ECS

| Export | Description | |---|---| | World | Manages entities, components, and systems | | System | Base class to extend for your own systems | | View | Iterates entities matching a set of component types | | ComponentPool | Sparse set storage for a single component type | | Component | Abstract base class for all components | | Profiler | Frame-time measurement for systems |

Components

| Export | Description | |---|---| | EntityComponent | Abstract base for spawnable FiveM entities | | CfxEntity | Holds a live FiveM entity handle | | Ped | Client-side ped component | | Vehicle | Client-side vehicle component | | Transform | Position, rotation, scale |

Math

| Export | Description | |---|---| | vec3 | Construct a Vec3 from values or a coords array | | vec3Add vec3Sub vec3Scale vec3Len | Common vector operations |

Decorators

| Export | Description | |---|---| | @shared | Marks a component class as shared across modules |

Usage

import { System, Component, vec3 } from "@ratprez/entm";
import type { World } from "@ratprez/entm";

class Health extends Component {
    current: number;
    max:     number;

    constructor(max: number) {
        super();
        this.current = max;
        this.max     = max;
    }
}

class HealthSystem extends System {
    override update(dt: number): void {
        for (const { health } of this.m_world.view(Health)) {
            // your logic here
        }
    }
}

declare function __registerModule(init: (world: World) => void): void;

__registerModule((world) => {
    world.addSystem(new HealthSystem(world));
});

License

ISC