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

@treble-tech/mmg-js

v0.1.1

Published

MMG (mmgs surface remesher) compiled to WebAssembly with a small JavaScript API. Licensed under the GNU LGPL-3.0, the same license as MMG.

Readme

mmg-js

pipeline coverage license: LGPL-3.0-only

MMG's surface remesher (mmgs) compiled to WebAssembly, plus a small JavaScript API for adaptive surface remeshing in the browser, in web workers, or in Node.

import { createRemesher } from '@treble-tech/mmg-js';

const remesher = await createRemesher();          // or { wasmUrl } / { moduleOverrides: { wasmBinary } }
console.log(remesher.version);                    // "5.8.0"

const out = remesher.remesh(
  { vertices, triangles, triangleRefs },           // Float64Array / Uint32Array / Uint32Array
  {
    hmin: 0.05, hmax: 0.5, hausd: 0.01, hgrad: 1.3,
    ar: 45, angle: true,
    localParams: [{ ref: 2, hmin: 0.01, hmax: 0.1, hausd: 0.001 }],
    sizeMap: null,                                 // optional per-vertex target edge length
  },
);
// out = { vertices, triangles, triangleRefs, edges, lowFailure }

Triangle references are inherited by every child triangle and interfaces between references are preserved, so per-region refinement survives the remesh. @treble-tech/mmg-js/medit exposes the Medit .mesh/.sol codec and an OBJ parser used under the hood.

Documentation: docs/USAGE.md (installation, loading the wasm with bundlers/workers, mesh format, every parameter, error handling) and docs/UPDATING_MMG.md (bumping the MMG or Emscripten version).

Package layout

| Path | What | | --- | --- | | src/js/ | JavaScript API (index.js) and Medit/OBJ codec (medit.js) | | src/c/jsmmg.c | C shim exporting jsmmg_remesh, jsmmg_add_local_param, jsmmg_clear_local_params, jsmmg_version on top of libmmgs | | third_party/mmg | Unmodified MMG sources, git submodule pinned to v5.8.0 | | dist/mmgs.wasm, dist/mmgs.js | Compiled MMG + shim and its Emscripten loader (committed, reproducible via build/build.sh) | | build/build.sh | Reproducible build recipe | | docs/ | Usage guide and MMG/Emscripten upgrade procedure |

Everything in this repository is licensed under the GNU LGPL-3.0 (see below).

Building from source

git clone --recursive https://gitlab.com/treble-public/mmg-js.git
cd mmg-js
build/build.sh        # uses the emscripten/emsdk:4.0.15 Docker image
npm test

Set JSMMG_NO_DOCKER=1 to use an emcc/emcmake already on your PATH (tested with emsdk 4.0.15). The script builds libmmgs.a with CMake (-DBUILD=MMGS, Scotch/VTK/Elas off) and links it with src/c/jsmmg.c into an ES-module loader (dist/mmgs.js) and a separate dist/mmgs.wasm.

The build is byte-reproducible for emsdk 4.0.15 regardless of checkout path (-ffile-prefix-map): CI rebuilds dist/ and fails if it differs from what is committed.

npm test runs the Node test suite; npm run test:ci (Node >= 22) additionally writes a JUnit report and lcov coverage for src/js to coverage/, which CI publishes as test and coverage reports.

Releasing

Pushing a vX.Y.Z tag that matches version in package.json runs the publish-npm CI job after build and tests pass. It publishes @treble-tech/mmg-js to npmjs.com with provenance, using the NPM_TOKEN CI/CD variable.

The job also requests a GitLab OIDC token (NPM_ID_TOKEN), which npm prefers over NPM_TOKEN once a trusted publisher is configured for the package on npmjs.com (GitLab CI/CD, namespace treble-public, project mmg-js, file .gitlab-ci.yml). After that, NPM_TOKEN can be deleted.

npm version 0.2.0 --no-git-tag-version   # bump package.json, then merge to main
git tag v0.2.0 && git push origin v0.2.0  # tag main

Licensing

The whole package -- MMG (third_party/mmg), the C shim, the JavaScript API, the build recipe, the tests and the compiled dist/mmgs.wasm / dist/mmgs.js -- is distributed under the GNU Lesser General Public License v3.0 (COPYING.LESSER, which supplements the GPL-3.0 text in COPYING). SPDX: LGPL-3.0-only. Using a single license for the repository keeps the obligations identical for every file and avoids any question about which terms apply to the combined WebAssembly binary.

The LGPL applies to this library; applications that merely use it (via createRemesher() and the separate mmgs.wasm file) are not required to be open source (LGPL-3.0 §4).

When you redistribute an application that uses this package, keep mmgs.wasm as a separate file that your users can replace (do not inline it into your own bundle), ship COPYING and COPYING.LESSER alongside it, and point users to this repository as the corresponding source (LGPL-3.0 §4). See THIRD_PARTY_NOTICES.md.