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

polymerge-core

v0.2.0

Published

polymerge engine: mesh loading and normalisation, vertex-correspondence diff and three-way merge for 3D models (Node and browser).

Readme

polymerge-core

The engine behind polymerge: loading and normalising 3D models (STL, OBJ, glTF/GLB), a tiered vertex-correspondence diff, and a region-based three-way merge with collision detection. It runs in Node and in the browser.

For the command line and the browser viewer, install @joshuahurley/polymerge instead; it provides the polymerge command.

npm install polymerge-core
import { readFile, writeFile } from 'node:fs/promises';
import { loadMesh, diffMeshes, mergeMeshes, resolveMerge, writeStl } from 'polymerge-core';

const load = async (file) => loadMesh(await readFile(file), { fileName: file });
const [base, ours, theirs] = await Promise.all(['base.stl', 'ours.stl', 'theirs.stl'].map(load));

const diff = diffMeshes(base, ours);
console.log(diff.tierName, diff.stats.vertices); // Tier 1 · index/ID (direct lineage) { unchanged: 152, moved: 10, … }

const merge = mergeMeshes(base, ours, theirs);
for (const c of merge.conflicts) console.log(`#${c.id} ${c.message}`);
const resolved = resolveMerge(merge, { 0: 'theirs' });
await writeFile('merged.stl', writeStl(resolved.merged));
  • loadMesh(bytes, { fileName? }) returns a welded, normalised IMesh. The format is detected from the bytes and the name.

  • diffMeshes(base, target, options?) returns an IDiffResult with:

    • the accepted tier and every attempt;
    • baseToTarget / targetToBase correspondences, and per-vertex and per-face status;
    • the global alignment (including unit conversions) and moved parts.
  • mergeMeshes(base, ours, theirs, options?) returns an IMergeResult with:

    • the merged mesh;
    • the conflict regions (unresolved ones keep the base geometry), with provenance and statistics.

    resolveMerge(result, { id: 'ours' | 'theirs' | 'base' }) re-materialises it with your choices.

  • writeStl / writeObj serialise a mesh.

The engine logs its decisions to the console. Pass logger: { info() {}, warn() {} } to silence it.

The types are documented in the source (dist/types.d.ts). The merge rules and the v1 limits are in the README and merge design notes.

MIT © Joshua Hurley