Skip to content

Latest commit

 

History

474 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

durably

Steps that survive crashes. SQLite to PostgreSQL.

Documentation | Live Demo

Packages

Package Description
@coji/durably Core library - job definitions, steps, and persistence
@coji/durably-react React bindings - hooks for triggering and monitoring jobs

Features

  • Resumable — each step's result is persisted; interrupted jobs resume from the last successful step
  • Parallel joins — run independent named steps concurrently and replay only unfinished branches after recovery
  • Flexible storage — libSQL/Turso, PostgreSQL, better-sqlite3, or browser OPFS
  • Browser + server — same API for Node.js and browsers
  • Lease-based recovery — stale workers are automatically reclaimed via fencing tokens
  • Auto cleanup — retainRuns option purges old completed runs automatically
  • React hooks — real-time progress via SSE, fullstack and SPA modes
  • Type-safe — Zod schemas for input/output, labels, and auth context

Quick Start

pnpm add @coji/durably kysely zod @libsql/client @libsql/kysely-libsql

See the Quick Start guide, or Choosing a Database for PostgreSQL and other backends.

Development

Use Node.js 24 and pnpm 12. The exact versions are declared in package.json; pnpm downloads the development runtime automatically.

pnpm install --frozen-lockfile
pnpm --filter @coji/durably exec playwright install chromium
pnpm validate
pnpm build

pnpm doctor:check scans the React bindings and all four React examples with React Doctor. It requires a complete 100/100 score for each project and also runs as part of pnpm validate and CI. pnpm doctor shows an interactive report. Keep any rule suppression adjacent to the affected line and explain why the behavior is intentional.

Docker must be running for PostgreSQL tests. Alternatively, set DURABLY_TEST_POSTGRES_URL to an existing PostgreSQL instance.

See the dependency migration notes for package-by-package compatibility decisions and validation, and ADR-0002 for runtime and compiler setup.

License

MIT

About

Step-oriented resumable batch execution for Node.js and browsers using SQLite

Resources

Stars

20 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages