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

@opsydyn/foldkit-zloz-force

v0.11.2

Published

Optional force layout and card-avoiding routing for ZLOZ.

Readme

@opsydyn/foldkit-zloz-force

Force layout and automatic orthogonal routing for ZLOZ. The adapter uses the FoldKit Viz simulation and requires Node.js 22 or newer for headless use.

The four public ZLOZ packages release together, with adapters pinned to the exact core version. The release train verifies registry archives and provenance before advancing to the next package.

Usage

Install @opsydyn/foldkit-zloz-force with its peer @opsydyn/foldkit-zloz. FoldKit Viz is a runtime dependency.

import { applyLayout, createEditor, layoutRequest } from '@opsydyn/foldkit-zloz';
import { createForceLayout } from '@opsydyn/foldkit-zloz-force';
import { supportsForceLayout } from '@opsydyn/foldkit-zloz-force/eligibility';

const editor = createEditor({
  nodes: [
    {
      id: 'start',
      label: 'Start',
      position: { x: 0, y: 0 },
      size: { width: 180, height: 100 },
      ports: [],
    },
  ],
  edges: [],
});

if (supportsForceLayout(editor.graph)) {
  const request = layoutRequest(editor, 'force-1');
  const result = await createForceLayout()(request);
  const arranged = applyLayout(editor, request, result);
}

The eligibility subpath lets a host enable its layout action without loading the simulation. In an Effect UI app, run the adapter in a command, keep the active request in the Model, and pass that current request to applyLayout on completion. That core operation rejects stale results and commits one undo step.

Behavior and limits

The initial adapter supports flat graphs of 1–100 nodes. It rejects invalid graphs and graphs containing groups. Use the ELK adapter for compound layouts.

The simulation runs a bounded set of ticks. Card spacing uses a circle around the largest measured node, and the adapter rejects results with overlapping cards. Input graph records are preserved.

Automatic edges receive candidate right-angle routes that avoid cards and penalize occupied corridors and crossings. Explicit edge path styles remain host-authored. A blocked route falls back to the editor's normal automatic edge path. Crossings and shared paths can still occur.

The adapter returns layout results and leaves application state ownership with the caller. The Astro workbench consumes this package as an example.

Package checks

bun run --filter @opsydyn/foldkit-zloz-force typecheck
bun run --filter @opsydyn/foldkit-zloz-force test
bun run --filter @opsydyn/foldkit-zloz-force pack:check

The package ships ESM, TypeScript declarations, an MIT licence, and third-party notices. Publish compatible ZLOZ core and Viz versions before releasing this adapter through the repository's manual publish workflow.

Custom normalized port anchors use the core's canonical points. Routing leads extend beyond the declared side of the node box before avoiding other cards; returned routes start/end at the authored anchors. This does not infer custom shape obstacles or arbitrary outward normals. With the core's built-in curved outlines, endpoints stay on the outline and leads still clear the conservative rectangular envelope before corridor search.