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

tosijs-3d

v0.8.7

Published

Declarative 3D/XR components for the web — Babylon.js and tosijs, composable as custom elements.

Readme

tosijs-3d

github | live demo | npm

tosijs-3d is a library for building 3D web apps — and standalone apps, if that is what you want. Under the hood it uses Babylon.js for rendering, glTF/GLB for models and the usual bitmap formats for textures — but it also leans on SVG, for textures and for the entire user interface.

Free and open source, and light for what it is (Babylon is not small; this adds little to it). Scenes are composed from web components, so a world is markup you can read:

b3d(
  b3dSun({ shadowCascading: true }),
  b3dSkybox({ timeOfDay: 6 }),
  b3dLoader({ url: './scene.glb' }),
  b3dWater({ y: -0.2 })
)

See the b3d page for that running, and every page here carries a live demo you can edit in place.

Four things you may not have seen in a 3D library

Flat 3D and VR are the same app. You can enter and leave an immersive session without the simulation resetting — the scene, the physics and your place in the world all survive the transition, because nothing is torn down to make it.

One user interface, in three places. The SVG-powered widget set renders identically as a DOM overlay, on a plane inside a 3D scene, and in VR. Not three implementations that drift — one, with three presentations, where any divergence is treated as a bug.

One control system, every input. Keyboard and mouse, gamepads, VR controllers and touch all arrive as the same ControlInput. You write the behaviour once; supporting a new device is a new provider, not a rewrite.

The simulation is testable without a GPU. The flight model, the combat maths, the world state and the layout engine are deliberately Babylon-free, deterministic, and unit-tested — so the interesting logic can be exercised in milliseconds rather than in a browser.

Finding things

Search the attribute index before assuming a capability does not exist — one greppable line per attribute, generated from source on every build. There is a JSON form for tools, and both ship inside the package, so an agent already in a consumer project reads node_modules/tosijs-3d/static/attributes.txt with no network.

It exists because the recurring adopter failure is not a missing feature, it is a feature that ships, is documented, and cannot be found: three issues in one week turned out to be capability that was already there. One grep water finds submersible; reading 147 doc pages does not.

Upgrading? See Migration.md for the breaking changes and what to do about them, and CHANGELOG.md for the full detail. Both ship inside the package, so they work from node_modules too.

import {
  b3d,
  b3dSun,
  b3dSkybox,
  b3dLoader,
  b3dWater,
  b3dReflections,
} from 'tosijs-3d'

document.body.append(
  b3d(
    { glowLayerIntensity: 1 },
    b3dSun({ shadowCascading: true }),
    b3dSkybox({ timeOfDay: 6, realtimeScale: 100 }),
    b3dLoader({ url: './scene.glb' }),
    b3dWater({ y: -0.2 }),
    b3dReflections()
  )
)

Highlights

Procedural astronomical objects — planets, stars and star systems, galaxies, and black holes with accretion disk, photon ring and lensing. Generated, not modelled — a solar system is a few attributes.

Procedural terrain — streaming LOD terrain with a biome shader that runs one material from seafloor to mountain, a floating origin so worlds can be large, and carved landforms — volcanoes with lava tubes bored through them, arches, caverns.

Biped control — a character controller with an animation state machine and follow/XR cameras, from a GLB.

Aircraft control — a forgiving flight model that flies like a drone below transition speed and like a plane above it, with VTOL, bank-to-turn, a HUD and radar.

One UI for flat, in-scene and VR — the widget set renders as a DOM overlay, as a texture on a surface in the scene, and as a floating panel in a headset, from the same declaration. Includes a flowing box model, menus and panels, a data table, and an on-screen keyboard — because a headset has nowhere to type.

SVG textures — draw with SVG, use it as a live texture. Designer artwork becomes a HUD, a gauge, or a control surface without a round-trip through a bitmap.

...and a few things that are less visible but are why the rest works:

Every input device behind one interface — keyboard/mouse, touch, hardware gamepads and XR controllers all produce the same ControlInput, so an entity is driven identically by a thumbstick, a glass pad, or an AI. Vehicle enter/exit and input focus come with it. Most frameworks hand you the input surface and wish you luck.

Simulation that doesn't know about the renderer — a pure, deterministic world store with a documented contract, so an external driver (a narrative engine, a test, a headless run) can drive a world the simulation never had to anticipate.

Adaptive by default — a device-capability probe vends per-tier budgets, and performance-sensitive settings resolve to auto rather than to a number that is always wrong for something. A Quest and a workstation get different worlds.

Pure models, actually tested — the flight model, ballistics, guidance, biome classification, layout and text editing are engine-free and unit-tested (1000+ assertions run in ~2s with no GPU). If it can be a function of its inputs, it is.

Development

Requires Bun.

bun install
bun start

Dev server runs on https://localhost:8030 with auto-rebuild on file changes.