Registry / devops / vow-queue

vow-queue

JSON →
library0.4.3jsnpmunverified

vow-queue is a lightweight JavaScript task queue with support for weights and priorities, built on the Vow promise library. Version 0.4.3 is the latest stable release. It allows enqueuing tasks with custom weight and priority levels, controlling concurrency via weight limits. The queue can be started and stopped, and provides statistics. It is primarily used in Node.js environments and has minimal dependencies. Alternatives include Bull or Kue but vow-queue is simpler and promise-based.

npm install vow-queue
INSTALL
IMPORT
SIG · VOW-QUEUE
V
vow-queue
devopsjavascriptv0.4.3
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.

default
✓ var Queue = require('vow-queue');
✗ import Queue from 'vow-queue';
CommonJS only; no ES module support.
Queue
✓ const queue = new Queue({ weightLimit: 10 });
✗ const queue = new queue({ weightLimit: 10 });
Queue is the constructor, not a factory.
enqueue
✓ queue.enqueue(taskFn, { weight: 2, priority: 3 });
✗ queue.enqueue(taskFn, weight: 2, priority: 3);
Second argument must be an object, not separate parameters.

Creates a queue with weight limit 10, enqueues three tasks (one sync, one async promise-based, one with custom priority/weight), then starts processing.

var Queue = require('vow-queue'); var queue = new Queue({ weightLimit: 10 }); queue.enqueue(function() { return 2 * 2; }); queue.enqueue(function() { var promise = require('vow').Promise(); setTimeout(function() { promise.fulfill('done'); }, 100); return promise; }); queue.enqueue( function() { console.log('high priority task'); }, { priority: 3, weight: 5 } ); queue.start();
Debug
Known issues
gotchaRequires 'vow' promise library; ensure it is installed.
fix
npm install vow vow-queue
affects: >=0.0.0
gotchaenqueue() parameters: second arg must be an object with optional 'weight' and 'priority' properties.
fix
Use queue.enqueue(fn, { weight: 2, priority: 3 });
affects: >=0.0.0
gotchaQueue does not auto-start; you must call .start() explicitly.
fix
Call queue.start() after enqueuing tasks.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'vow-queue'
vow-queue not installed or not in node_modules
fix
npm install vow-queue
TypeError: queue.enqueue is not a function
Queue not instantiated correctly (e.g., missing 'new')
fix
Use var queue = new Queue();
ReferenceError: Queue is not defined
Did not require the module
fix
var Queue = require('vow-queue');
Upgrade
Version history
0.4.3latest on npm
Audit
Dependencies
vowrequiredpromise implementation used by queue
Agent activity
12 hits · last 30 days
node
12
Resources
vow-queue — npm install vow-queue · libregistry