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

@stablemodels/durable-bash

v0.2.0

Published

Cloudflare Durable Object-backed [`IFileSystem`](https://www.npmjs.com/package/just-bash) adapter for [just-bash](https://www.npmjs.com/package/just-bash). Lets bash commands persist files in a Durable Object's SQLite storage.

Readme

durable-bash

Cloudflare Durable Object-backed IFileSystem adapter for just-bash. Lets bash commands persist files in a Durable Object's SQLite storage.

Install

npm install @stablemodels/durable-bash

Peer dependencies: just-bash, @cloudflare/workers-types

Usage

import { Bash } from "just-bash";
import { DurableFs } from "@stablemodels/durable-bash";

// In a Cloudflare Worker:
const fs = await DurableFs.create(env.FS, "my-agent");
const bash = new Bash({ fs, cwd: "/home" });
const result = await bash.exec('echo "hello" > greeting.txt && cat greeting.txt');
console.log(result.stdout); // "hello\n"

Wrangler config

[[durable_objects.bindings]]
name = "FS"
class_name = "FsObject"

[[migrations]]
tag = "v1"
new_sqlite_classes = ["FsObject"]

Re-export the DO class from your worker:

export { FsObject } from "@stablemodels/durable-bash/object";

API

DurableFs implements IFileSystem from just-bash:

  • readFile(path) / readFileBuffer(path) — Read file contents
  • writeFile(path, content) / appendFile(path, content) — Write/append
  • exists(path) / stat(path) / lstat(path) — Check existence and metadata
  • mkdir(path, opts?) / readdir(path) / readdirWithFileTypes(path) — Directories
  • rm(path, opts?) / cp(src, dest, opts?) / mv(src, dest) — File operations
  • chmod(path, mode) / utimes(path, atime, mtime) — Metadata changes
  • symlink(target, linkPath) / link(existing, new) / readlink(path) / realpath(path) — Links
  • static create(namespace, name, cwd?) — Factory: creates stub, syncs cache, returns ready instance
  • getAllPaths() — Synchronous cached path list for glob matching

Exports

| Export | Path | Description | |--------|------|-------------| | DurableFs | @stablemodels/durable-bash | IFileSystem adapter | | DurableFs, FsStat, DirentEntry | @stablemodels/durable-bash/fs | Adapter-only entry point (no DO class or errors) | | FsStat, DirentEntry | @stablemodels/durable-bash | Stat/dirent types (boolean properties, not methods) | | normalizePath | @stablemodels/durable-bash | Path normalizer (resolves ./.., ensures leading /) | | FsObject | @stablemodels/durable-bash/object | Durable Object class — re-export in your worker | | FsError, ENOENT, EEXIST, EISDIR, ENOTDIR, ENOTEMPTY | @stablemodels/durable-bash | POSIX-style errors | | FsStatData, DirentData | @stablemodels/durable-bash | RPC wire-format types |

Development

bun install
bun test              # all 121 tests
bun run test:unit     # unit tests only
bun run test:integration  # integration + smoke tests
bun run build         # tsc → dist/
bun run check         # biome lint
bun run format        # biome format

Test structure

| File | Scope | |------|-------| | tests/fs-object.test.ts | Unit tests for FsObject DO | | tests/durable-fs.test.ts | Unit tests for DurableFs (mock stub) | | tests/integration.test.ts | End-to-end: DurableFs + FsObject | | tests/just-bash.test.ts | Bash commands through DurableFs |

Tests mock cloudflare:workers via a preload script (tests/setup.ts, configured in bunfig.toml) and use bun:sqlite to simulate DO SQLite storage.

CI/CD

  • PR checks: Lint, build, and tests run automatically on pull requests via GitHub Actions.
  • NPM publishing: Triggered automatically on merge to main. Requires an NPM_TOKEN secret in the repository/org settings.

License

MIT