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

@cnvx/nodal

v1.0.1

Published

Draw edges between HTML elements with zero JavaScript — <n-edge> declarations compiled to CSS anchor positioning

Readme

nodal

Draw edges between HTML elements with zero JavaScript.

@cnvx/nodal lets you write connections in plain HTML with <n-edge>. A build-time compiler turns those declarations into CSS anchor-positioned edge elements: no measurement loop, no observers, nothing to hydrate.

Zero JavaScript, precisely: on Chrome/Edge 125+ and Firefox 147+ a diagram renders and tracks layout with static HTML and CSS alone. Safari — at every version — and older engines run a compiled 5,460-byte fallback that measures the endpoints instead. Compile with fallback: "none" and no script ships at all, at the cost of hiding edges on engines without CSS anchor positioning. Full matrix below.

npm add -D @cnvx/nodal

Rendered docs and live demos: https://nodal.convex.works

Quick Start

nodal draws the edge; your CSS lays out the nodes. from-anchor="right" declares that the target sits to the right of the source, so the surface needs a layout that puts it there. Without one — plain block layout stacks the nodes — the edge box collapses to zero width and nothing is painted.

<div
  class="nodal"
  style="display: flex; align-items: center; justify-content: space-between"
>
  <div id="start">
    Start
    <n-edge to="#end" from-anchor="right" to-anchor="left">next</n-edge>
  </div>

  <div id="end">End</div>
</div>

Any layout works — flex, grid, absolute positioning, your own classes. The rule is only that the layout must agree with the anchors you declared. Anchorless edges (<n-edge to="#end">) connect center to center and survive any arrangement.

With plain Vite HTML:

import { nodal } from "@cnvx/nodal/vite";

export default {
  plugins: [nodal()],
};

With SvelteKit:

// src/hooks.server.ts
import { nodalHandle } from "@cnvx/nodal/sveltekit";

export const handle = nodalHandle();
<!-- in a page that hydrates -->
<script>
  import { Nodal } from "@cnvx/nodal/svelte";
</script>

<Nodal>
  <!-- nodes and <n-edge> declarations -->
</Nodal>

The handle renders <Nodal> edges into the server response, and the component adopts them during hydration. On a client-only navigation or in an SPA, the same component compiles them in the browser.

For HTML emitted by another build tool:

npx @cnvx/nodal dist

Browser Support

nodal renders through CSS anchor positioning, which shipped in Chrome/Edge 125 (May 2024), Safari 26.0 (September 2025) and Firefox 147 (January 2026) — about 81.7% of global traffic (caniuse, July 2026). Everything else is covered by the compiled fallback, which is on by default.

| Engine | Anchor positioning | Default output (fallback: "inline") | fallback: "none" | | ---------------------------------------- | ------------------ | ----------------------------------------- | --------------------- | | Chrome / Edge 125+ | yes | native CSS; the runtime exits at load | native CSS, no script | | Firefox 147+ | yes | native CSS; the runtime exits at load | native CSS, no script | | Safari 26+ | yes | compiled fallback runtime (see below) | native CSS, no script | | Chrome < 125, Firefox < 147, Safari < 26 | no | compiled fallback runtime | edges are hidden |

The fallback is not a polyfill of anchor positioning. The compiler has already resolved every endpoint, so the runtime only measures those elements and writes ordinary pixel insets, then re-measures on resize, relevant DOM/style mutation, and font load.

Safari is always on the fallback path. src/lib/fallback.ts disqualifies WebKit by vendor, at every version, because Safari 26 accepts anchor positioning but can latch its size-container probes at zero under layout churn — a timing-dependent failure no one-shot feature probe can catch. Set fallback: "none" to put Safari 26+ on the native zero-JS path and accept that constraint yourself; see Limitations.

Payload

What the compatibility path costs, measured on the Quick Start page above (one edge with a label):

| Output | One-edge page | Script on the page | | ------------------------------------- | ------------- | ------------------------------------------------------------- | | compile(html) (default) | 9,014 bytes | 5,460 bytes inline (≈1.7 KB gzipped), inert on Chrome/Firefox | | compile(html, { fallback: "none" }) | 2,698 bytes | none |

Turn the compatibility output off when you need strictly script-free HTML. This removes its manifests, CSS, and JavaScript rather than leaving dormant fallback bytes:

compile(html, { fallback: "none" });
npx @cnvx/nodal dist --fallback none

Documentation

The chapters live in this repository and render at https://nodal.convex.works/docs:

The site also hosts a playground that compiles <n-edge> in the browser with the same compile() the build carriers use.

Public API

import { compile, compileFragment } from "@cnvx/nodal";
import { nodal } from "@cnvx/nodal/vite";
import { nodalHandle } from "@cnvx/nodal/sveltekit";
import { Nodal } from "@cnvx/nodal/svelte";
import { mount, scanNodalFallback } from "@cnvx/nodal/fallback";
import "@cnvx/nodal/elements";
  • compile(html, options?) transforms an HTML string.
  • compileFragment(fragment, options?) returns a compiled island (html + css + baseCss) for hydrated apps.
  • nodal(options?) compiles Vite HTML entries and emitted HTML assets.
  • nodalHandle(options?) compiles SvelteKit server-rendered pages, including hydrated <Nodal> surfaces.
  • <Nodal> from @cnvx/nodal/svelte adopts server-compiled edges when the handle ran, and compiles the same <n-edge> HTML client-side for SPAs and client navigation.
  • mount(surface, artifact) wires a compiled island to the DOM; scanNodalFallback(root?) is the low-level compatibility runtime.
  • @cnvx/nodal/elements adds Svelte template types for <n-edge>.

The compiler relies on no Node.js APIs or filesystem access and runs in any modern JavaScript runtime — Node, Bun, browsers, workers (verified by the browser/worker smoke test).

License

MIT