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

@ifc-lite/geometry

v1.18.5

Published

Geometry processing bridge for IFC-Lite - 1.9x faster than web-ifc

Readme

@ifc-lite/geometry

Streaming geometry processor for IFClite. Converts IFC bytes to renderable mesh batches via Rust + WASM (or Tauri native), with first triangles in 300–500ms and progressive streaming for large models.

Installation

npm install @ifc-lite/geometry

Process geometry from IFC bytes

import { GeometryProcessor } from '@ifc-lite/geometry';

const processor = new GeometryProcessor();
await processor.init();

const buffer = new Uint8Array(await file.arrayBuffer());
const result = await processor.process(buffer);

console.log(`${result.meshes.length} meshes, ${result.totalTriangles} triangles`);
// Each mesh: { expressId, positions: Float32Array, normals, indices: Uint32Array, color, ifcType }

Stream geometry (recommended for large models)

for await (const event of processor.processStreaming(buffer)) {
  if (event.type === 'batch') {
    renderer.appendMeshes(event.meshes);
    console.log(`Loaded ${event.totalSoFar} meshes so far`);
  } else if (event.type === 'complete') {
    console.log(`Done: ${event.totalMeshes} meshes`);
  }
}

The streaming path emits batches every ~100 meshes so the renderer can paint progressively — first triangles typically arrive 300–500ms after processStreaming() returns.

Coordinate handling

import { CoordinateHandler } from '@ifc-lite/geometry';

const result = await processor.process(buffer);

// Models with large world coordinates (geo-referenced) get auto-shifted
// to keep float precision inside the renderer.
if (result.coordinateInfo?.hasLargeCoordinates) {
  const { x, y, z } = result.coordinateInfo.originShift;
  console.log(`Origin shifted by [${x}, ${y}, ${z}] for renderer precision`);
}

Vite setup

The geometry workers ship as ESM and use the standard new Worker(new URL('./geometry.worker.js', import.meta.url), { type: 'module' }) spawn pattern. Vite's default worker.format: 'iife' setting can't host ESM workers, so consumers need one config line:

// vite.config.ts
import { defineConfig } from 'vite';

export default defineConfig({
  worker: { format: 'es' },
});

This is the same contract that Mapbox-GL, Three.js, Cesium, and Monaco require — ESM workers are not the Vite default, but they are the modern standard and the pattern wasm-bindgen produces by default.

If your bundler can't transform new URL('ifc-lite_bg.wasm', import.meta.url) inside the worker bundle (or you serve the wasm from a CDN at a separate origin), pass explicit wasm URLs through the processAdaptive / processParallel wasmUrls option:

// Vite's `?url` suffix yields a fully-resolved URL string at build time.
// `@ifc-lite/wasm` and `@ifc-lite/wasm-threaded` both expose the binary
// at the `./ifc-lite_bg.wasm` subpath so this resolves cleanly through
// the package's `exports` map.
import wasmUrl from '@ifc-lite/wasm/ifc-lite_bg.wasm?url';

for await (const event of processor.processAdaptive(buffer, {
  wasmUrls: { wasm: wasmUrl },
})) { /* ... */ }

The worker forwards the URL to wasm-bindgen's documented init(url) parameter, bypassing the default new URL(..., import.meta.url) resolution inside the worker entirely. For webpack 5 use new URL('@ifc-lite/wasm/ifc-lite_bg.wasm', import.meta.url).href; for other bundlers, any string the runtime can resolve to the binary works.

Performance

  • First triangles: 300–500ms (streaming path)
  • Throughput: up to 5× faster than web-ifc on the same model
  • Worker support: files > 50 MB process off-main-thread automatically
  • Native (Tauri): preferNative: true constructor option enables the native Rust pipeline for desktop builds

API

See the Geometry Guide and API Reference.

License

MPL-2.0