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

wiki-graph-sdk

v0.9.5

Published

Node.js SDK for running Wiki Graph programmatically with local config, libraries, and jobs.

Readme

wiki-graph-sdk

The Node.js application SDK behind the wiki-graph CLI. It provides typed, programmatic access to local configuration, libraries, durable build jobs, and the runtime-neutral APIs from wiki-graph-core.

Requires Node.js >=22.12.0.

npm install wiki-graph-sdk
import { createWikiGraphSDK } from "wiki-graph-sdk";

const wikiGraph = createWikiGraphSDK({ stateDir: "/path/to/state" });
const jobs = await wikiGraph.jobs.list();

for (const job of jobs) {
  console.log(job.snapshot);
}

wikiGraph.close();

Electron and other Node hosts may provide their own lifecycle identity and storage layout without importing wiki-graph-core:

import {
  createNodeWikiGraphPlatform,
  createNodeWikiGraphStorage,
  createWikiGraphSDK,
} from "wiki-graph-sdk";

const wikiGraph = createWikiGraphSDK({
  host: {
    platform: createNodeWikiGraphPlatform({ lifecycle }),
    storage: createNodeWikiGraphStorage({
      libraryRoot: "/path/to/home",
      documentStoreRoot: "/path/to/documents",
    }),
    stateDir: "/path/to/state",
  },
});

Storage and SDK configuration state are scoped to the SDK instance. Platform services, including lifecycle, are process-wide; SDK instances in one process must use one compatible platform. The top-level stateDir remains a shorthand for the default Node host. When supplying host.storage, put the independent configuration root in the required host.stateDir field instead. A custom host.storage without host.stateDir is rejected rather than falling back to the current user's ~/.wikigraph directory.

Applications may replace the configured LLM and embedding implementations for one SDK instance:

const wikiGraph = createWikiGraphSDK({
  providers: {
    llm: myStreamingLLMProvider,
    embedding: myEmbeddingProvider,
  },
});

await wikiGraph.jobs.runWorker();

An operation-level llm option (the typed SDK equivalent of CLI --llm) takes precedence over the injected LLM provider. An injected provider takes precedence over local database configuration. Injected objects are process-local and are not persisted with durable jobs, so a worker in another process must create its SDK with the same providers. The standalone default worker continues to use local configuration.

Job event subscriptions observe durable work without coupling observation to cancellation. Call job.cancel() explicitly to cancel a job; unsubscribing only stops the current listener.

libraries.searchBuckets() projects one shared search session into typed, independently paginated buckets. Continue one bucket with libraries.continueSearchBucket(); sibling cursors remain unchanged. The existing libraries.search() API keeps its sequential single-cursor result.

Services that receive chapter job artifacts as files can apply an ordered, lazy sequence through the Node delivery boundary without importing Core:

import { applyWikiGraphJobArtifacts } from "wiki-graph-sdk/worker";

await applyWikiGraphJobArtifacts({
  archive: { kind: "standalone", path: "/tmp/job/archive.wikg" },
  artifacts,
  stateDir: "/tmp/job/sdk-state",
});

Each artifact carries its chapter, job kind, and source revision. The operation stops before consuming later artifacts when a revision no longer matches.

The SDK intentionally has no execute(command, args) API. CLI argument parsing, help text, terminal formatting, JSON, and JSONL rendering belong to the wiki-graph package. SDK methods return typed objects and job events.