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

@x12i/hybrid-graph

v0.2.0

Published

Tier 2: Edge-native graph database with recursive CTE traversals and referential integrity built on @x12i/hybrid-docstore

Downloads

340

Readme

@x12i/hybrid-graph

The Tier 2 graph layer of the @x12i Edge Data Stack. Sits atop @x12i/hybrid-docstore to provide a graph database interface for Nodes, Edges, and recursive CTE traversals compiled directly to SQLite WITH RECURSIVE queries at the edge.

Features

  • Built Atop Tier 1: Does not communicate with D1/R2 directly; uses an instance of HybridDocStore to manage nodes and edges collections.
  • Node Content Offloading: Nodes inherit Tier 1 transparent offloading rules for heavy properties (e.g., node content, documents, media).
  • Referential Integrity Cascades: When a node is deleted via graph.deleteNode(id), all associated incoming and outgoing edges are automatically queried and removed first to prevent dangling edges.
  • Edge-Native Recursive CTE Traversals: Multi-hop graph discovery is compiled into parameterized SQLite WITH RECURSIVE queries executed inside SQLite at the edge, featuring cycle protection (instr(path, ...)).
  • Traversal Separation: Traversals yield lightweight nodes for relationship discovery; heavy payloads are hydrated as a subsequent step via Tier 1 .withContent().
  • Zero-Config .env Support: Automatically connects using the same .env variables as @x12i/hybrid-docstore, including an optional HYBRID_DB_FOLDER.

Quick Start

import { createGraphFromEnv } from '@x12i/hybrid-graph';

// Reads from .env automatically
const graph = await createGraphFromEnv();

// 1. Create Nodes (heavy payload 'content' is offloaded to storage)
const author = await graph.addNode({ label: 'User', name: 'Alice' });
const book = await graph.addNode({
  label: 'Book',
  title: 'Edge Graph Computing',
  content: Buffer.from('Full manuscript chapter 1...'),
});

// 2. Link Nodes
await graph.link(author, book, 'AUTHORED', { year: 2026 });

// 3. Multi-hop Traversal (Recursive CTE executed in SQLite at the edge)
const reachable = await graph.traverse(author, { maxDepth: 3 });

// 4. Subsequent Hydration via Tier 1
const bookNodes = reachable.filter((n) => n.label === 'Book');
const hydratedBooks = await graph.docstore
  .collection('nodes', { heavyProperties: ['content'] })
  .find({ id: { $in: bookNodes.map((b) => b.id) } })
  .withContent(['content']);