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

@babylonjs/lite

v1.43.0

Published

A lightweight, tree-shakable, WebGPU-first rendering library derived from Babylon.js.

Readme

Babylon Lite

A lightweight, tree-shakable, WebGPU-first rendering library derived from Babylon.js. Import only what you use and ship a minimal bundle.

Installation

npm install @babylonjs/lite

Quick start

import { createEngine, createSceneContext, createDefaultCamera, createHemisphericLight, addToScene, loadGltf, registerScene, startEngine } from "@babylonjs/lite";

async function main(): Promise<void> {
    const canvas = document.getElementById("renderCanvas") as HTMLCanvasElement;

    const engine = await createEngine(canvas);
    const scene = createSceneContext(engine);

    addToScene(scene, await loadGltf(engine, "https://playground.babylonjs.com/scenes/BoomBox.glb"));
    addToScene(scene, createHemisphericLight([0, 1, 0], 1.0));
    createDefaultCamera(scene);

    await registerScene(scene);
    await startEngine(engine);
}

main().catch(console.error);

Bundling

Optional features load on demand through import(), so an empty scene built with Vite 8, Rolldown, or Rollup loads a single chunk up front.

  • Keep startup code in an async function main() rather than using top-level await in your entry module. With top-level await, bundlers keep modules shared with lazy chunks out of the entry, which adds small up-front chunks.
  • With esbuild, consider bundling without --splitting. Its code splitting turns every import() in the package into a separate entry and splits shared code per file, so even an empty scene loads many small chunks. Without splitting, every lazy feature your app can reach moves into the initial file, so apps that defer heavy features should compare initial bytes and request count for both options.

OpenUSD

loadUsd() loads .usd, .usda, .usdc, and .usdz with the same protocol-versioned OpenUSD WebAssembly extractor used by Babylon.js, then materializes the command/data buffers as native Lite entities:

import { addToScene, loadUsd } from "@babylonjs/lite";

const asset = await loadUsd(engine, "/assets/model.usdz");
addToScene(scene, asset);

For composed stages, pass every external layer, payload, and texture through the virtual files map while preserving authored paths:

const asset = await loadUsd(engine, rootLayer, {
    rootFileName: "Package/Scenes/Main.usda",
    files: {
        "Package/Layers/Geometry.usdc": geometryLayer,
        "Package/Textures/Albedo.png": albedo,
    },
});

The worker, glue, WASM, and data bundle default to the Babylon.js CDN. Set runtimeBaseUrl to a directory containing all four protocol-v5 files to self-host them.

Documentation

Full documentation is available at https://doc.babylonjs.com/lite/.

Optional navigation

Navcat navigation loads offline-baked JSON and runs pure-JavaScript path/surface queries without Wasm. Generation, off-mesh mutation and CPU debug geometry are independently optional. The existing Recast backend remains available. See the Navcat lab demo for filters, mesh replacement and disposal/reload.

Headless simulation (null engine)

Babylon Lite can run without a GPU or canvas for server-side physics, deterministic simulation, or CI — the Lite analogue of Babylon.js NullEngine. Use createNullEngine() instead of createEngine(), and drive the loop yourself with stepScene():

import { createNullEngine, stepScene, createSceneContext } from "@babylonjs/lite";

const engine = createNullEngine(); // no device, no canvas — synchronous
const scene = createSceneContext(engine, { defaultRenderTask: false });

// ...add physics bodies / onBeforeRender callbacks...

for (let i = 0; i < 180; i++) stepScene(engine, scene, 1000 / 60); // simulate 3s

It needs no WebGPU and runs on plain Node (recommended), Deno, Web Workers, or CI. Rendering is out of scope. See the Headless (Null Engine) guide for details, supported runtimes, and limitations.

Right-handed coordinate system

Babylon Lite is left-handed by default. To render right-handed, like Babylon.js with scene.useRightHandedSystem = true, add the babylon-lite-rh resolve condition to your bundler. Your code does not change, and the handedness is a constant the minifier folds away: with Rolldown, which builds the lab scenes, a left-handed bundle is byte-for-byte the one built before this option existed. esbuild keeps the handedness checks and a few small helpers, so its bundles grow slightly.

The modules in lib/ import #coordinate-system, a package import declared in this package's imports map. Bundlers that read imports (Vite, webpack 5, esbuild, Rolldown, Rollup with @rollup/plugin-node-resolve) resolve it; native browser ESM and bundlers without imports support do not. The prebuilt dist/index.js has no such import and is left-handed.

// vite.config.ts
import { defineConfig, defaultClientConditions } from "vite";

export default defineConfig({
    resolve: { conditions: [...defaultClientConditions, "babylon-lite-rh"] },
});

Every engine in that bundle is right-handed. See the Right-Handed Coordinate System guide for webpack, esbuild and Rollup, and for the features covered so far.

License

Apache-2.0

@babylonjs/lite is a derivative of Babylon.js (Apache-2.0). It bundles a small number of third-party runtime libraries (manifold-3d, @recast-navigation/*, text-shaper, navcat, mathcat) whose code ships inside the published package. Their license texts — together with those of the upstream native components embedded in their WebAssembly (Recast & Detour and the Emscripten runtime) — are reproduced in NOTICE.txt.

Development-only tooling (build, test, and lint frameworks) is not part of the published package and therefore carries no redistribution obligations.