Duty is a simple job queue for Node.js that runs in-memory by default, requiring no external database for basic use. Version 2.5.1 is the latest stable; releases are infrequent. Key differentiators: dumb-simple API, database-agnostic via dbstream, supports progress events, timeouts, retries with backoff, and concurrency control. Lighter than Kue or Bull, no Redis needed for simple cases.
npm install dutyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a job handler for counting lines in a file and adds a job to the queue.
Configure a persistent backend: duty.db(require('dbstream-mongo').connect('...'))Use a modern queue like Bull or Kue if promise-based workflows are needed.
Use require('duty') or import with createRequire.Ensure you require('duty') and use duty.register (it is a function).