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

@dwk/store

v0.1.0-beta.2

Published

DO-SQLite quad store + R2 copy-on-write blob bodies behind one storage interface.

Readme

@dwk/store

DO-SQLite quad store + R2 copy-on-write blob bodies behind one storage interface.

Part of the @dwk IndieWeb + Solid cohort. See the package specification for the full requirements.

Runs inside the @dwk/solid-pod Durable Object and confines all Cloudflare storage specifics, so the endpoint packages stay storage-agnostic and unit-testable. Authoritative state lives only in DO SQLite and R2 — never KV.

What it does

  • One interface, two backends. RDF triples live in the DO's SQLite quad store; opaque bodies live in R2. head, readQuads, writeQuads, patchQuads, putBlob, readBlob, putResource, and delete hang off a single Store.
  • Transactional writes. writeQuads / patchQuads apply an N3-Patch's deletes+inserts in one transactionSync, and the If-Match / If-None-Match preconditions are checked and applied inside the same transaction, so check-and-write is TOCTOU-free. delete accepts an optional in-transaction guard for the same reason (e.g. LDP container emptiness).
  • Copy-on-write blobs. putBlob writes a new content-addressed R2 object, then atomically flips the DO pointer and outboxes any now-unreferenced predecessor key. Reads are streamed straight from R2 — never buffered.
  • Size-threshold routing. putResource keeps small RDF in the quad store and offloads anything over the ~2 MB DO-cell ceiling to R2 as an opaque blob.
  • Sweep-free GC. Deletes drop the pointer first and record the orphaned key to a transactional outbox in the same SQLite transaction. forwardOrphans drains the outbox into a shared D1 tracking store, and collectGarbage reclaims R2 objects after a safety window using only D1 and R2 — it never scans or wakes a per-pod Durable Object.
  • Resurrection-safe reclaim. Because keys are content-addressed, a deleted key can be revived by a later putBlob of identical content. collectGarbage deletes version-conditionally (re-checking the R2 version between head and delete) and putBlob cancels an already-forwarded GC row, so GC never reclaims an object a live resource points at.
import { createStore } from "@dwk/store";

// Inside the solid-pod Durable Object:
const store = createStore(state, env);
const etag = await store.putBlob("/photo.jpg", bytes, {
  contentType: "image/jpeg",
});
const body = await store.readBlob("/photo.jpg"); // { stream, etag, ... }

License

ISC