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

@danielsimonjr/fourjs-core

v0.1.0

Published

Shared foundation infrastructure — the dependency-free base of every other package. Part of [fourJS](../../README.md).

Readme

@fourjs/core

Shared foundation infrastructure — the dependency-free base of every other package. Part of fourJS.

Implements §6a (component model), §6b (eventing), and the §83/§85 error model from docs/SPECIFICATION.md; shipped in Phase 1 (§104), with later hoists of shared utilities.

What's here

  • EventEmitter — the one typed emitter API used by nodes and the application (§6b); re-entrant emissions queue and defer.
  • Component model (§6a) — Component, ComponentType, ComponentHost, and ComponentRegistry; one component per type per host.
  • Errors — FourError / FourErrorCode / isFourError (§83, §85).
  • Lifecycle — Disposable and disposeAll.
  • SeededRandom — xorshift128 with splitmix32 seeding; the deterministic RNG the §33–34 machinery relies on (@fourjs/motion and @fourjs/particles re-export it).
  • JSON utilities — JsonValue and cloneJsonValue (refuses payloads carrying a __proto__ own key).
  • DEFAULT_GRAVITY_Y — the shared gravity convention (§7a: right-handed Y-up world; gravity is negative Y in both 2D and 3D).
  • Space modes (§8) — SpaceMode, SPACE_MODES, DEFAULT_SPACE_MODE, isSimulationSpaceMode. Vocabulary only, hoisted here for the DEFAULT_GRAVITY_Y reason: §8's two halves belong to pillars that may not import each other. @fourjs/physics is the one consumer today (RigidBody.space); no renderer places a node by a §8 mode — read the header of src/space.ts before authoring one.
  • Unit system (§40) — UnitSystem, SI_UNITS, resolveUnitSystem, and the …ToDisplay / …FromDisplay / format… helpers. Display and authoring conversion only (spec rev 1.3): declaring a unit system changes nothing the engine computes — every API signature stays radians, seconds, and world units, and the helpers are barred from simulation paths because their arithmetic is inexact in the last bits (§33–§34). Read the header of src/units.ts before using them.

Staged / not yet implemented

  • §101's "unit application in simulation" — @fourjs/physics reading scale.lengthToMeters for the §41 precision envelope (2026-08-07).
  • Serializing the unit system into the §79 document header, so a scene reloads in its authored units; waits on a format revision (2026-08-07).
  • Text parsing of authored units ("90°" → radians) — the numeric direction (angleFromDisplay) is what §40 asks for; a locale-aware parser is not (2026-08-07).
  • The plugin host (§81).
  • §8's node-level declaration — a one-field NodeSpace component. Blocked on its §79 serializer: a component class carries a static typeName, and one with no registered serializer makes serializeScene throw, so the class and its registration in registerSceneNodeTypes (umbrella package) must land together, with the render-side consumer that gives screen/viewport/camera/billboard a meaning (2026-08-09, PH-12).

Unit tests are colocated in tests/ per §92.

Workspace name @fourjs/core; publishes as @danielsimonjr/fourjs-core.