adapter-queue v0.3.0 is a TypeScript queue system inspired by Yii2-Queue architecture, providing a clean abstraction for job processing with multiple storage backends (database, SQS, file) and event-based job handling. It offers type-safe APIs with full TypeScript support, driver-based architecture for swapping backends seamlessly, and supports features like TTR, delay, priority (per driver). The library is actively developed, requires Node.js >=18, and has peer dependencies for SQS (@aws-sdk/client-sqs), SQLite (better-sqlite3), MongoDB (mongoose), and Redis. Unlike similar systems (e.g., Bull, Bee-Queue), adapter-queue focuses on minimal boilerplate, driver flexibility, and Yii2-inspired simplicity with an event-driven handler registration.
npm install adapter-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a file-based queue, registers typed handlers, adds a job with TTR, and starts continuous polling every 3 seconds.
Update constructor: new FileQueue({ path: './queue-data' }) instead of new FileQueue('./queue-data')Convert project to ESM (type: 'module' in package.json) or use dynamic import().
Use DbQueue with an adapter that implements priority if needed.
Replace queue.stop() with queue.run(false).
Call queue.setHandlers() before queue.run().
Use ESM import: import { FileQueue } from 'adapter-queue'Switch to ESM or use dynamic import: const { FileQueue } = await import('adapter-queue')Add queue.setHandlers({ ... }) before queue.run().Upgrade to v0.2.0+ and use queue.addJob().