StashJS logo

StashJS

A zero-dependency, ephemeral, crypto-agnostic content store for Node.js - bytes in, ref out.
Zero dependencies Crypto-agnostic Streaming-first ESM, no build step Apache-2.0

Every page in this reference is generated from the library's own source comments. You put bytes in and get a ref back - a 256-bit random capability, not a content address. You take the bytes out, and when the terms say once, they're gone.

Quick start

npm install @blamejs/stash
import { Stash } from "@blamejs/stash";
import { MemoryBackend } from "@blamejs/stash/backends/memory";

const stash = new Stash({ backend: new MemoryBackend() });
const ref = await stash.push(ciphertext);   // ref: 'v1_...' - a capability
const entry = await stash.show(ref);        // metadata only, never contents
const readable = await stash.apply(ref);    // digest-verified stream
TipRun the process holding the blobs under the Node permission model -- a process-level filesystem allowlist, with the write grant scoped to the store and read spanning the app directory (Node loads its module graph from disk): mkdir -p .stash && node --permission --allow-fs-read=. --allow-fs-write=./.stash app.js. A compromised dependency cannot reach outside the grant to the wider filesystem.

Design tenets

Namespaces