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

@memnest/ui-core

v0.1.0

Published

Framework-free UI logic for Memnest: controllers, graph layout, clustering, viewport math and canvas drawing.

Downloads

349

Readme

@memnest/ui-core

Framework-free UI logic for Memnest: the controllers behind the dashboard's views, graph layout, topic clustering, viewport math, hit-testing and canvas drawing. No React, no Vue, no DOM: every controller is getState() plus subscribe(listener), so a framework wrapper is a few lines (@memnest/ui-react is one).

import { createMemnestClient } from '@memnest/client';
import { createWorkspace } from '@memnest/ui-core';

const workspace = createWorkspace({ client: createMemnestClient({ baseUrl: '' }), containerTag: 'user:123' });

workspace.trace.setQuery('what database does this user use?');
workspace.trace.setTokenBudget(200);
await workspace.trace.run();
workspace.trace.getState().rows; // every candidate, why it was included or excluded, and the budget line

workspace.select(memoryId);       // detail and lineage load; the graph highlights it
workspace.detail.requestForget();
await workspace.detail.confirmForget(); // trace, finder, timeline and graph refresh

client is any MemnestApi, including the embedded engine, so the same controllers run in tests with no server.

| Controller | What it holds | |---|---| | graph | The global graph: filter, clusters above 2,000 matching memories, force layout, viewport, selection, lineage overlay, hover | | lineage | One memory's lineage as a layered (Sugiyama-style) DAG | | trace | A search's candidates joined with their text, cumulative tokens and the budget line | | timeline | A topic's facts over time: version chains as lanes, each switch dated | | detail | A memory, its version history, relations and sources; two-step forget | | finder | Search or browse memories |

Layout. computeLayout(nodes, edges, { algorithm: 'force' | 'layered' }) is deterministic for a seed. For large graphs, run it in a worker:

// layout.worker.ts
import { serveLayoutRequests } from '@memnest/ui-core';
serveLayoutRequests(self);

// app
const layout = createWorkerLayoutRunner(new Worker(new URL('./layout.worker.ts', import.meta.url), { type: 'module' }));
createWorkspace({ client, containerTag, layout }); // graphs of 500+ nodes lay out off the main thread

Drawing. buildGraphScene(state, theme) turns graph state into circles and lines, and drawScene(ctx, scene, viewport, size, theme) paints them on any 2D canvas context. Labels are culled and capped per frame.