A file system-based FIFO queue implemented using the maildir format, providing lockfree operations for durability and simplicity. Version 0.3.0 is the latest release (last updated in 2014). The library supports push, pop (with blocking on empty queues), transactional pop (tpop) with commit/rollback, length, and clear operations. Objects are serialized as JSON. It is designed for environments where a lightweight, filesystem-backed queue is needed. Alternatives like better-queue or bull use databases or Redis; file-queue is purely filesystem-based with no external dependencies. The package is in maintenance mode but still functional for Node.js projects.
npm install file-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a queue, push, pop, transactional pop with commit, get length, and clear.
Wrap pop in a timeout or setInterval with length check if non-blocking needed.
Avoid using nested tpop if strict ordering is required.
Use graceful-fs by passing `fs: require('graceful-fs')` in options.Consider migrating to an active library like better-queue or bull.
Run `npm install file-queue` and use `require('file-queue').Queue` for CommonJS.Use `import { Queue }` or `const Queue = require('file-queue').Queue`.Use graceful-fs: `new Queue({ path: '.', fs: require('graceful-fs') })`.Ensure Queue is properly constructed: `const queue = new Queue('path', callback)`.No dependency data recorded yet.