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

@lofcz/openscad-wasm

v0.0.2

Published

OpenSCAD compiled to WebAssembly, with runtime extensions for fonts (text()) and the MCAD library

Readme

@lofcz/openscad-wasm

OpenSCAD compiled to WebAssembly — render .scad to STL/3MF/OFF/… in the browser or Node, no native binary required.

Built from lofcz/openscad-wasm, which tracks openscad/openscad-wasm plus:

  • the freetype no-hinting patch — stock builds trap the whole WASM module (RuntimeError: null function or function signature mismatch) on any font without a TrueType bytecode program, i.e. most modern fonts;
  • mirrored GMP/MPFR downloads with pinned checksums for reliable CI builds;
  • runtime extensions: bundled Liberation fonts (text()) and the MCAD library.

Install

npm install @lofcz/openscad-wasm

Browser usage

import createOpenSCAD from "@lofcz/openscad-wasm";
import { addFonts } from "@lofcz/openscad-wasm/fonts";

const instance = await createOpenSCAD({ noInitialRun: true });
addFonts(instance); // optional: enables text() with bundled Liberation fonts

instance.FS.writeFile("/input.scad", "cube(10);");
const exit = instance.callMain([
  "/input.scad",
  "--backend", "Manifold",
  "--export-format", "binstl",
  "-o", "/out.stl",
]);
if (exit !== 0) throw new Error(`openscad exited with ${exit}`);

const stl = instance.FS.readFile("/out.stl"); // Uint8Array

Bundlers: make sure openscad.wasm is served as a static asset. The wrapper resolves it with new URL("openscad.wasm", import.meta.url); Vite and webpack 5 handle that pattern natively.

Node usage

Node's fetch cannot load file:// URLs, so hand the module the binary directly:

import { readFileSync } from "node:fs";
import { createRequire } from "node:module";
import createOpenSCAD from "@lofcz/openscad-wasm";

const require = createRequire(import.meta.url);
const wasmBytes = readFileSync(require.resolve("@lofcz/openscad-wasm/openscad.wasm"));

const instance = await createOpenSCAD({
  noInitialRun: true,
  instantiateWasm(imports, done) {
    WebAssembly.instantiate(wasmBytes, imports).then((r) => done(r.instance));
    return {};
  },
});

API

See openscad.d.ts. The surface is the emscripten module: callMain(args) runs openscad <args>, FS is the in-memory filesystem the .scad input, MCAD/fonts and exported files live in.

Rebuilding

The WASM binary is built from the repo root with Docker only:

make ENV=release   # or: ./build.sh
make npm           # assemble this package from build/ artifacts

License

GPL-2.0 — see COPYING. OpenSCAD and its dependencies (CGAL, FreeType, HarfBuzz, …) are compiled into the binary.