Registry / devops / better-queue-memory

better-queue-memory

JSON →
library1.0.4jsnpmunverified

An ephemeral, in-memory store for the better-queue task queue library. Version 1.0.4 is the current stable release; no major updates since initial publication. It is the default store for better-queue and offers the fastest possible performance because all data lives in memory. Unlike persistent stores (e.g., SQLite or Redis), this store loses all queued items on process restart. It is ideal for development, testing, or workloads where queue durability is not required. The package is maintained as part of the diamondio/better-queue ecosystem.

npm install better-queue-memory
INSTALL
IMPORT
SIG · BETTER-QUEUE-MEMOR
B
better-queue-memory
devopsjavascriptv1.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MemoryStore
import MemoryStore from 'better-queue-memory'
const MemoryStore = require('better-queue-memory')
Package is ESM-only? Check package.json exports. CommonJS require may still work.
default export
const MemoryStore = require('better-queue-memory')
const { MemoryStore } = require('better-queue-memory')
The default export is the store constructor. Named import like an object with MemoryStore key is wrong.
new MemoryStore()
new MemoryStore()
MemoryStore()
Must be instantiated with 'new'.

Creates a better-queue using MemoryStore as the store option. Note MemoryStore is the default, but explicitly passing it shows usage.

import Queue from 'better-queue'; import MemoryStore from 'better-queue-memory'; const q = new Queue( (input, cb) => { // process input cb(null, input); }, { store: new MemoryStore() } ); q.push(1); q.push(2);
Debug
Known issues
breakingQueue data is lost on process restart or crash.
fix
Use a persistent store like better-queue-sqlite or better-queue-redis for durable queues.
affects: all
gotchaMemoryStore is used by default if no store is provided to better-queue.
fix
If you want a different store, you must explicitly pass it in the options.
affects: all
deprecatedNo formal deprecation but the package is rarely updated.
fix
Consider better-queue v2 or alternative queue libraries if you need active maintenance.
affects: all
Errors
Common errors & fixes
TypeError: MemoryStore is not a constructor
Importing MemoryStore incorrectly (e.g., as named export) or using it without `new`.
fix
Use `const MemoryStore = require('better-queue-memory');` then `new MemoryStore()`.
Cannot find module 'better-queue-memory'
Package not installed or project not using correct module resolution.
fix
Run `npm install better-queue-memory` and ensure node_modules is present.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies
better-queuerequiredPeer dependency; this store is a plugin for better-queue and cannot be used without it.
Agent activity
8 hits · last 30 days
node
6
Amazon
1
Resources
better-queue-memory — npm install better-queue-memory · libregistry