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

3dfusion

v0.1.0

Published

Deterministic 3D world systems in the browser.

Readme

3dfusion

A deterministic, 3D world runtime for modern browsers.

Overview

3dfusion is a packaged runtime that moves core 3D simulation, procedural generation, and rendering orchestration into WebAssembly, exposing a clean, predictable API for JavaScript and TypeScript consumers. Designed for browser delivery, it provides deterministic terrain and chunk generation, memory-managed mesh pipelines, rigid-body physics, adaptive streaming, and runtime telemetry without requiring consumers to manage internal engine architecture.

The project emphasizes:

  • Predictable outputs from stable seeds and deterministic pipelines
  • Browser-first delivery with optimized WASM artifacts and lightweight JS bindings
  • Explicit resource management to maintain stable memory profiles in long-running sessions

Key Features

  • Deterministic Generation & Streaming
    Seeded terrain and chunk production, heightfield sampling, and bounded streaming around a moving viewpoint with motion-aware prioritization.
  • Geometry & Mesh Pipeline
    Primitive and semantic geometry construction, procedural mesh generation with LOD support, and direct vertex and index buffer access.
  • Physics & Rendering Orchestration
    Fixed-step rigid-body simulation, configurable spatial broadphase, and renderer-side draw queueing with material and shader variant support.
  • Performance & Memory Management
    Frame scheduling, execution-path optimization, memory budgeting with priority-based upload queues, and automated resource eviction.
  • Telemetry & Diagnostics
    Centralized dashboard payload generation, debug control overrides, mobile and touch input tracking, and per-stage performance breakdowns.
  • Explicit Lifetime Management
    Structured disposal via free() and [Symbol.dispose]() for deterministic cleanup of native WASM resources.

Quick Start

npm install 3dfusion
import { init, TerrainGenHandle, MeshGeneratorHandle, StreamerHandle } from "3dfusion";

async function main() {
  await init();

  const terrainGen = new TerrainGenHandle(0, 50.0, 0.01, 64, 64.0);
  const streamer = new StreamerHandle(12345n, "", 0, 50.0, 0.01, 64, 64.0);
  streamer.set_active_region(3, 2, 2);
  streamer.set_budget(8, 12);
  streamer.update(0, 0, 0);

  const heightfield = terrainGen.generate_heightfield(12345n, 0, 0, 0, 0);
  const mesh = heightfield.toMesh(terrainGen, 12345n, 0, 0, 0, 0);

  console.log(`Generated mesh: ${mesh.vertex_count()} vertices`);
}

main();

Architecture

3dfusion follows a strict separation between the core simulation layer and the browser integration surface:

  1. Rust Core: All deterministic logic, simulation, and data structures are implemented in Rust.
  2. WebAssembly Compilation: The core is compiled to wasm32-unknown-unknown for near-native browser execution.
  3. Binding Generation: wasm-pack produces JavaScript and TypeScript bindings, handles memory marshaling, and exposes the public API surface.
  4. Supplemental Tooling: Debug panels, diagnostic dashboards, and platform harnesses are bundled as lightweight JS modules.
  5. Distribution: The final artifact is packaged for direct consumption via standard module bundlers.

Development

Prerequisites

  • Rust stable toolchain
  • wasm-pack
  • Node.js

Setup & Commands

rustup target add wasm32-unknown-unknown
npm install
npm run build:wasm
npm run dev

Build Script Behavior

  • If wasm-pack is unavailable but cargo is present, the build script installs it automatically.
  • wasm-opt is applied when available to reduce release artifact size; builds gracefully fall back if absent.
  • The development script installs missing vite dependencies before launching the local server.

Documentation

The complete API reference, including handle constructors, method signatures, and expected behavior, is documented in FUNCTIONALITY.md.

The reference covers:

  • runtime bootstrap
  • semantic parsing and geometry authoring
  • mesh generation, bounds reporting, and buffer extraction
  • terrain and chunk generation plus streaming controls
  • physics, rendering, scheduling, optimization, and memory management
  • platform diagnostics and telemetry payloads

Best Practices

  • Explicit Disposal: Always call handle.free() or use [Symbol.dispose]() when handles are no longer needed.
  • Frame Budgets: Respect work and upload budgets to maintain consistent frame pacing, especially on mobile or constrained environments.
  • Deterministic Seeding: Use consistent world_seed values for reproducible terrain, chunk, and streaming outputs.

For integration support, bug reports, or contribution guidelines, refer to the project repository.