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

@skein-js/storage-memory

v0.18.0

Published

In-memory SkeinStore + queue driver for development and tests.

Readme

@skein-js/storage-memory

npm downloads license

In-memory SkeinStore + run queue + event bus for development and tests.

Part of skein-js — the open-source alternative to LangGraph Platform for TypeScript: a self-hosted Agent Protocol server for LangGraph.js, and a drop-in replacement for the LangGraph CLI.

Status: 🚧 Pre-alpha — implemented; passes the shared SkeinStore conformance suite.

What it does

Zero-dependency, in-process drivers that power skein dev and back the test fixtures. They implement the @skein-js/core contracts, so the engine uses them unchanged:

  • MemorySkeinStore — a SkeinStore over plain Maps (assistants / threads / runs / store items), with the run-concurrency guard, thread→runs cascade delete, and naive prefix/substring store search. Every read and write deep-clones at the boundary — like a real serializing driver — so callers can't mutate stored rows or corrupt the store through a retained reference.
  • MemoryRunQueue — a single-process queue of background runs. FIFO for ready work, plus a delayed set for after_seconds; idempotent on run_id, so a re-enqueue of a run already waiting, delayed, or in flight is a no-op.
  • MemoryRunEventBus — buffered run-frame pub/sub with replay (afterSeq) and live-tail, so a client can join a run's stream late or reconnect.

Validated against the shared SkeinStore conformance suite, so it behaves identically to the Postgres driver — the same tests run against both.

Install

pnpm add @skein-js/storage-memory

No peer dependencies. Pair it with MemorySaver (from @langchain/langgraph) as the graph checkpointer — this package stores only Agent Protocol resources, never graph state.

Usage

Construct with new — there is no connect/migrate step:

import { MemorySkeinStore, MemoryRunQueue, MemoryRunEventBus } from "@skein-js/storage-memory";

const store = new MemorySkeinStore();
const thread = await store.threads.create({ metadata: { user: "a" } });
await store.threads.get(thread.thread_id);

Wired into an engine as a full set of in-memory drivers (this is what skein dev does):

import { MemorySaver } from "@langchain/langgraph";
import { createProtocolRuntime } from "@skein-js/agent-protocol";
import { MemoryRunEventBus, MemoryRunQueue, MemorySkeinStore } from "@skein-js/storage-memory";

const runtime = createProtocolRuntime({
  store: new MemorySkeinStore(),
  queue: new MemoryRunQueue(),
  bus: new MemoryRunEventBus(),
  checkpointer: new MemorySaver(),
  graphs, // a GraphResolver, e.g. from @skein-js/config
});

API

  • class MemorySkeinStore implements SkeinStore — new MemorySkeinStore({ ttl?, threadTtl?, maxPageSize? }). ttl is store-item expiry and threadTtl is thread expiry ({ defaultTtl?, sweepIntervalMinutes? }, minutes) — see docs/storage.md. maxPageSize (default 1000) bounds every list/search, including one with no limit — see docs/storage.md. Exposes the four repos (assistants, threads, runs, store) defined by SkeinStore. Plus two methods used by skein dev's persistence:

    • snapshot(): MemoryStoreSnapshot — serialize all rows.
    • hydrate(snapshot: MemoryStoreSnapshot): void — restore a snapshot (used to survive restarts).
  • interface MemoryStoreSnapshot — the serialized form (assistants / assistantVersions / threads / runs / runKwargs / items / crons entry arrays). An alias of core's SkeinStoreSnapshot.

  • class MemoryRunQueue implements RunQueue — new MemoryRunQueue(). enqueue(run, options?) (options.delayMs holds the run back — the run-create after_seconds; kept in an unref'd timer, so a restart loses it, like every other run in this queue) · consume(process, options?) (options.concurrency default 1) → a RunConsumer with close(force?).

  • class MemoryRunEventBus implements RunEventBus — new MemoryRunEventBus(options?). publish(runId, frame) · close(runId) · subscribe(runId, afterSeq = 0), plus trackedChannelCount / bufferedFrameCount for diagnostics.

    Options: maxFramesPerRun (default 10000) is a hard maximum on one run's buffer — past it the oldest frames go, which ends the stream of any subscriber that had not read them. maxRetainedRuns (default 50) is how many finished runs stay replayable for a late join; beyond it a run's channel is deleted, not blanked, and its id is remembered for finishedIdTtlMs (default 24h) so the join still completes rather than waiting forever. now injects a clock.

    Prefer resolveMemoryBusLimits() from @skein-js/server-kit over hand-passing the bounds — it applies SKEIN_MEMORY_BUS_* from the environment, which is what every skein-assembled runtime does.

See @skein-js/core for the full SkeinStore / RunQueue / RunEventBus method signatures these implement.

Reuse

Pairs with MemorySaver (re-exported from @langchain/langgraph) for graph checkpoints — it stores only Agent Protocol resources, never graph state.

Learn more

License

Apache-2.0