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

autoremesher

v0.1.1

Published

Automatic quad remeshing of triangulated surfaces, compiled to WebAssembly

Readme

autoremesher

Automatic quad remeshing of triangulated surfaces, compiled to WebAssembly.

Upstream C++: huxingyi/autoremesher — MIT licensed, copyright (c) 2020-2026 Dust3D Project / Jeremy HU.

Converts a triangle mesh into clean quad topology. The wasm build runs single-threaded (TBB is shimmed to sequential equivalents) and needs a larger stack than typical wasm modules because Eigen stack-allocates heavily.

Install

npm install autoremesher

Usage

const { remesh } = require('autoremesher');

const result = await remesh({
  vertices: [0, 0, 0, 1, 0, 0, 0, 1, 0 /* ... */],
  indices: [0, 1, 2 /* ... */],
  targetTriangleCount: 1000,
});

result.vertices; // Float64Array, flat [x, y, z, ...]
result.indices;  // Uint32Array, flat [i0, i1, i2, i3, ...] (quads, stride 4)

targetTriangleCount is required — upstream refuses to remesh when it is unset or zero. indices is always stride 4; any non-quad faces left by upstream cleanup are dropped.

Optional knobs (omit to keep upstream defaults; 0 is a valid explicit value where the algorithm treats it as off): scaling, modelType ('organic' | 'hardSurface'), gradientAdaptivity, sharpEdgeDegrees, anisotropy, smoothNormalDegrees.

The package is CommonJS-only; TypeScript types ship as js/index.d.ts.

Environments

Works in Node.js, browsers, and Electron preload (where process.type === "renderer" makes emscripten's Node detection fail). The JS wrapper reads the .wasm via fs and instantiates it through instantiateWasm whenever Node APIs are available; in the browser, pass locateFile / wasmBinary to loadModule() if your bundler does not serve the .wasm next to the glue script:

const { loadModule, remesh } = require('autoremesher');

await loadModule({
  locateFile: (file) => `https://cdn.example.com/${file}`,
});

Building from source

The C++ sources come from the upstream/ git submodule (pinned to huxingyi/autoremesher); local fixes live in patches/ and are applied by build.sh. A sequential TBB shim lives in src/tbb_shim/ so the build does not need real TBB or Qt.

git submodule update --init --recursive   # if not cloned with --recurse-submodules
EMSDK=$HOME/emsdk npm run build           # or have em++ on PATH

Output lands in build/ (autoremesher.js + autoremesher.wasm).

Patches

  • patches/0001-fix-wasm32-halfedge-key-shift.patch — under wasm32 size_t is 32-bit, so the vendored isotropicremesher's (first << 32) | second halfedge key collapsed to second. Fixed by widening before the shift (same fix as the isotropicremesher package).

License

MIT — see LICENSE.