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/wasm

v4.1.4

Published

WebAssembly bindings for IFC-Lite

Readme

@ifc-lite/wasm

Pre-built WebAssembly bindings for the IFClite Rust core, covering STEP parsing and geometry tessellation (including the pure-Rust exact CSG kernel).

You probably don't need to use this package directly. It's the WASM binary plus generated JS/TypeScript bindings that @ifc-lite/parser, @ifc-lite/geometry, and @ifc-lite/renderer consume internally. Reach for it when you want raw access to the Rust core without the higher-level wrappers.

Installation

npm install @ifc-lite/wasm

Direct WASM use

The text-based entity scanner (scanEntitiesFast) takes the raw IFC text (a string) — decode the buffer first; scanEntitiesFastBytes takes the raw Uint8Array bytes directly. The geometry methods (buildPrePassOnce, processGeometryBatch, see below) also take the raw Uint8Array bytes.

import init, { IfcAPI } from '@ifc-lite/wasm';

await init();                         // load and instantiate the WASM module

const api = new IfcAPI();
const buffer = await fetch('model.ifc').then(r => r.arrayBuffer());
const content = new TextDecoder().decode(buffer);

// Fast entity scan — returns an array of entity references
const refs = api.scanEntitiesFast(content);
console.log(`Entities: ${refs.length}`);

api.free();                           // free the API instance

Meshes (pre-pass + job batches)

Geometry runs as a single pre-pass (one scan that produces a flat job list plus unit scale, RTC offset, void/style indices) followed by processGeometryBatch calls over slices of that job list. Pass the IFC bytes (Uint8Array) to these methods:

import init, { IfcAPI } from '@ifc-lite/wasm';

await init();
const api = new IfcAPI();
const bytes = new Uint8Array(await fetch('model.ifc').then(r => r.arrayBuffer()));

const pre = api.buildPrePassOnce(bytes);
// Large-coordinate models: pre.needsShift / pre.rtcOffset give the RTC origin.
for (let start = 0; start < pre.totalJobs; start += 100) {
  const end = Math.min(start + 100, pre.totalJobs);
  const jobs = pre.jobs.slice(start * 3, end * 3);
  const collection = api.processGeometryBatch(
    bytes, jobs, pre.unitScale,
    pre.rtcOffset?.[0] ?? 0, pre.rtcOffset?.[1] ?? 0, pre.rtcOffset?.[2] ?? 0,
    pre.needsShift,
    pre.voidKeys, pre.voidCounts, pre.voidValues,
    pre.styleIds, pre.styleColors,
  );
  for (let i = 0; i < collection.length; i++) {
    const mesh = collection.get(i);
    scene.add(toThreeMesh(mesh)); // mesh.expressId, .ifcType, .positions, .normals, .indices, .color
    mesh.free();
  }
  collection.free();
}

api.clearPrePassCache();
api.free();                           // release the API instance when done

Most consumers should use @ifc-lite/geometry's GeometryProcessor instead — it wraps this pre-pass/job-batch flow with a Web-Worker pool, RTC coordinate handling, and progressive streaming.

Exports

| Class | Purpose | |---|---| | IfcAPI | Top-level entry point — scanEntitiesFast / scanEntitiesFastBytes / scanGeometryEntitiesFast, buildPrePassOnce / buildPrePassStreaming, processGeometryBatch, extractProfiles, parseSymbolicRepresentations | | MeshCollection, MeshDataJs | Tessellated geometry output | | ProfileCollection, ProfileEntryJs | Cross-section profile data (extruded-area solids) | | SymbolicRepresentationCollection, SymbolicCircle, SymbolicPolyline | 2D symbolic representations (for plan / annotation views) |

All classes implement free() and [Symbol.dispose]() — call free() (or use using) to release Rust-side memory.

When to use a higher-level package instead

| You want… | Use | |---|---| | A typed, idiomatic TS API for parsing | @ifc-lite/parser | | Streaming geometry with worker support | @ifc-lite/geometry | | WebGPU rendering | @ifc-lite/renderer | | To avoid managing WASM lifecycles by hand | Any of the above |

Rust source

This package ships the bindings only. The Rust source lives in rust/wasm-bindings/ and the core in rust/core/. Available on crates.io as ifc-lite-core.

API

See the WASM API Reference.

License

MPL-2.0