Sidetrack is a TypeScript-first job processing library backed by PostgreSQL (current version 0.1.14). It is actively developed with a focus on simplicity, reliability, and TypeScript ergonomics. Unlike general-purpose message brokers (like RabbitMQ or Redis-based queues), Sidetrack leverages Postgres as both the backing store and the scheduling engine, enabling transactional enqueuing and strong consistency. It supports delayed jobs, retries, concurrency control, and rate limiting. The library is designed for serverless and Edge environments where a single Postgres database is already in use, avoiding additional infrastructure. It requires a running Postgres instance and the pg driver. While still in early development (pre-1.0), it has a growing community and is considered stable for production use. Release cadence is irregular but frequent (several minor releases per month).
npm install sidetrackNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize Sidetrack with a pg Pool, define a worker, enqueue a job, start processing, and handle graceful shutdown.
Upgrade to v0.1.0+ and pass an options object with a `pool` property (an instance of `pg.Pool`).
Ensure all `worker()` calls happen before `start()`.
Call `await st.init()` right after creating the Sidetrack instance.
Replace `addWorker(name, handler)` with `worker(name, handler)`.
Define an interface and use `st.enqueue<MyData>('queue', data)`.Call `await st.init()` before any other operations.
Update to v0.1.10+ and use `st.worker(name, handler)`.
Add a generic type: `st.enqueue<YourDataType>('queue', data)`.Update to `new Sidetrack({ pool: new Pool({ connectionString }) })`.