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

@eraserlabs/resolve

v0.2.0

Published

Pure Eraser resolve engine

Downloads

2,573

Readme

@eraserlabs/resolve

Introduction

@eraserlabs/resolve turns an authored diagram document into fully-resolved element data. It validates tags against a template library, applies derived-prop normalizers, sanitizes text, inlines icons, and emits a split { entities, connections } payload for @eraserlabs/render. There is no server, filesystem, or network of its own: icon loading and similar I/O are injected by the caller.

It owns the authored input grammar. A document is an object envelope — either { elements } or a split { entities, connections } with both keys required. A bare JSON array is rejected (E_ENVELOPE). Authored TypeScript shapes (AuthoredEntity, AuthoredConnection, DiagramInput) are exported from this package; @eraserlabs/protocol owns the resolved contracts.

All authored dimensions are rounded to the nearest integer during resolution: every element's x/y/width/height, each connection waypoint in points, and the labelPlacement box. The layout engine works on the integer grid, so fractional coordinates (float dust from app exports or measured round trips) are canonicalized rather than carried.

Why

Resolution has to run in Node, in the CLI, and in the browser playground with the same results. Coupling it to Chromium or a framework would force every consumer to take that dependency. A library that fails schema or template checks throws at createResolver, so no resolver exists over a vocabulary the engine has not proven it can run.

Usage

import { createResolver } from '@eraserlabs/resolve';
import { stockLibrary } from '@eraserlabs/diagram-templates';
import { stockNormalizers } from '@eraserlabs/diagram-templates/normalizers';

const resolver = await createResolver({
  library: stockLibrary,
  normalizers: stockNormalizers,
});

const result = await resolver.resolve({
  entities: [
    { tag: 'Shape', id: 'a', x: 0, y: 0 },
    { tag: 'Shape', id: 'b', x: 200, y: 0 },
  ],
  connections: [{ from: 'a', to: 'b' }],
});

createResolver compiles the library once. resolve returns { ok, entities, connections, icons, warnings, errors }; validate runs the same pipeline without inlining icon bytes. Supply iconLoader to fetch SVGs by name; onUnknownIcon is 'placeholder' or 'error'.

Portable document, component, font, and schema-vocabulary contracts live in @eraserlabs/protocol. Compatibility re-exports remain at @eraserlabs/resolve/schema. Component authoring is documented in CUSTOMIZATION.md.