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

@meshinspector/meshlib-mt

v3.2.0-85

Published

MeshLib geometry library compiled to WebAssembly (multi-threaded), with the complete API generated from the C++ headers.

Readme

@meshinspector/meshlib-mt

MeshLib geometry library compiled to WebAssembly — the multi-threaded build, with the complete MeshLib API generated from the C++ headers as ES modules with TypeScript declarations.

This is the higher-throughput sibling of @meshinspector/meshlib (single-threaded), with an identical API. It uses worker threads and SharedArrayBuffer to parallelize geometry operations.

  • Source: https://github.com/MeshInspector/MeshLib
  • Documentation: https://meshlib.io/documentation/index.html

Requirements

Install

npm install @meshinspector/meshlib-mt

Usage

The same as @meshinspector/meshlib, see its README for the API overview, memory management, bundlers and TypeScript. In short:

import * as ml from '@meshinspector/meshlib-mt';

await ml.init();

using mesh = ml.makeUVSphere(1, 64, 64);
using settings = new ml.DecimateSettings();
settings.maxError = 0.01;
settings.subdivideParts = 16; // decimated in parallel
ml.decimateMesh(mesh, settings);
console.log('faces after decimation =', mesh.topology.numValidFaces());

JS callbacks can only run on the thread that called init(), and MeshLib calls some of them from its worker threads, which aborts the module: preCollapse and adjustCollapse of DecimateSettings with subdivideParts > 1 (keep it at 1 when passing them), the data of a FunctionVolume in marchingCubes() (use @meshinspector/meshlib there). Progress callbacks are safe, MeshLib reports progress only from the calling thread.

Browser: cross-origin isolation

The multi-threaded build relies on SharedArrayBuffer, which browsers only enable on cross-origin isolated pages. The server must send these headers for the page that loads the module:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Without them crossOriginIsolated is false and init() never resolves. Where you cannot set response headers (GitHub Pages and similar static hosting), a coi-serviceworker-style shim re-serves the page with the headers. In Node.js nothing is needed.

Use from CDN

The browser refuses to run a worker script from another origin, so the worker pool of the module must start from a same-origin URL: fetch the module and pass it to init() as a Blob. The module must be the one of the imported release, so pin it by its tag (v1.2.3.456 is an example, take a real one from the releases page):

import * as ml from 'https://js.meshlib.io/[email protected]/index.mjs';

const url = 'https://js.meshlib.io/[email protected]/MeshLibC2.mjs';
const blob = new Blob( [ await ( await fetch( url ) ).text() ], { type: 'text/javascript' } );
await ml.init( { mainScriptUrlOrBlob: blob } );

The unpinned https://js.meshlib.io/meshlib-mt/index.mjs re-exports the latest release, but only the pinned directory holds the module files.

Migrating from the 3.x packages

The packages up to 3.1.x shipped a hand-written Embind module with a part of the API. That module is still published, as @meshinspector/meshlib-light-mt: to keep the old API, switch to it, replacing meshlib-mt with meshlib-light-mt in the package and file names (meshlib-light-mt.mjs, meshlib-light-mt.wasm). This package has a different, generated API:

  • The default export (import createMeshLib, const ml = await createMeshLib()) became a namespace import and an init() call: import * as ml from '@meshinspector/meshlib-mt'; await ml.init();.
  • On the CDN the entry point is index.mjs instead of meshlib-mt.mjs.
  • The classes, functions and fields now follow the C++ API one to one (the same names, parameters and defaults as in the C++ reference), so the hand-written helpers of the old module have no direct counterparts: look up the C++ function instead.
  • Objects are still freed with .delete() (or using), and the typed-array conversions are toArray()/view()/fromArray().