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

@bitbybit-dev/ifc-worker

v1.5.0

Published

Bit By Bit Developers IFC library to write, read and author BIM models via WebWorker

Readme

@bitbybit-dev/ifc-worker

The @bitbybit-dev/ifc library behind a web worker, so reading, authoring and writing IFC building models never blocks the page.

Beta. The API's names and inputs may still change before the first stable version.

Overview

Every method of @bitbybit-dev/ifc is here under the same dotted path, answering with a promise. Models live in the worker: a call that makes a model hands back a small handle, { hash, type: "ifc-model" }, which the next call takes in its place. A call made again with the same inputs is answered from the worker's cache, except the calls meant to differ each time: model.create without a seed and model.write without a timeStamp run every time.

The renderer packages (@bitbybit-dev/babylonjs, @bitbybit-dev/threejs, @bitbybit-dev/playcanvas) include it as bitbybit.ifc: their initBitByBit hands the worker you pass as workers.ifcWorker to bitbybit.ifcWorkerManager.setIfcWorker, and code that calls bitbybit.init itself makes that call too. Use this package directly when you want IFC without them.

The worker file

// ifc.worker.ts
import { initializationComplete, onMessageInput } from "@bitbybit-dev/ifc-worker";

initializationComplete();
addEventListener("message", ({ data }) => onMessageInput(data, postMessage));

Using it

import { BitByBitIFC } from "@bitbybit-dev/ifc-worker";

const bitbybit = new BitByBitIFC();
bitbybit.init(new Worker(new URL("./ifc.worker.ts", import.meta.url), { type: "module" }));

let model = await bitbybit.ifc.model.create({ name: "House", seed: "house-1" });
model = await bitbybit.ifc.spatial.addStorey({ model, id: "ground", elevation: 0 });
model = await bitbybit.ifc.walls.add({ model, storey: "ground", start: [0, 0], end: [6000, 0], height: 3000 });
const text = await bitbybit.ifc.model.write({ model, fileName: "house.ifc" });

With a renderer package's bitbybit object, draw a model by describing it as a recipe and building the recipe with the Manifold kernel:

const recipe = await bitbybit.ifc.geometry.recipe({ model });
const solids = await bitbybit.manifold.recipes.build({ recipe, adjustZtoY: true });
await bitbybit.draw.drawAnyAsync({ entity: solids });

ifcWorkerManager.ifcWorkerState$ reports the worker's state: loading once it is handed over, initialised once it has started, then computing and loaded as calls come and go. A worker whose script cannot load reports failed, and every call waiting on it is rejected.

To load the worker only when it is first needed, hand over a factory instead: ifcWorkerManager.setIfcWorkerFactory(() => new Worker(...)) makes the worker on the first IFC call, so a page that never calls the IFC library never downloads it. Until then the state is loaded, and startedTheRun and cleanAllCache answer at once, since there is nothing to clean.

IFCWorkerMock runs the library on the same thread through the same messages, each mock with models of its own and every message copied as a worker's would be, for tests and for scripts that need no worker.

Links

| Resource | URL | |----------|-----| | GitHub | https://github.com/bitbybit-dev/bitbybit/tree/master/packages/dev/ifc-worker | | Monorepo | https://github.com/bitbybit-dev/bitbybit | | NPM | https://www.npmjs.com/package/@bitbybit-dev/ifc-worker | | Documentation | https://learn.bitbybit.dev/learn/npm-packages/ifc | | Example | https://learn.bitbybit.dev/learn/code/common/ifc/family-house |