Registry / storage / fastqueue

fastqueue

JSON →
library0.1.0jsnpmunverified

A fast FIFO queue for Node.js that uses a two-array cycling strategy to avoid the O(n) reindexing cost of Array.shift() on large queues. Version 0.1.0 is the only release, currently in maintenance mode. Key differentiator: implements only push/shift/unshift/length with minimal overhead, unlike alternatives like denque or double-ended-queue which offer more features.

npm install fastqueue
INSTALL
IMPORT
SIG · FASTQUEUE
F
fastqueue
storagejavascriptv0.1.0
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.

Queue
✓ const Queue = require('fastqueue')
✗ import Queue from 'fastqueue'
This package only supports CommonJS (require). No ESM or named exports available.

Shows basic FIFO queue operations: push, shift, unshift, and length property.

const Queue = require('fastqueue'); const q = new Queue(); q.push(1); q.push(2); console.log(q.shift()); // 1 console.log(q.shift()); // 2 console.log(q.length); // 0 q.unshift(3); console.log(q.shift()); // 3
Debug
Known issues
gotchaPackage does not expose an ESM interface; using import will fail.
fix
Use require() instead of import.
affects: >=0
gotchaQueue only supports push/shift/unshift and length; no iteration, peek, or clear methods.
fix
Check if these features are needed; consider using denque or double-ended-queue for richer API.
affects: >=0
gotchaThe tiny queue implementation may have subtle bugs with large numbers of elements due to internal array cycling.
fix
Test thoroughly if using with very large queues; consider using a well-maintained alternative.
affects: >=0
Errors
Common errors & fixes
Error: Cannot find module 'fastqueue'
Package not installed or incorrectly spelled.
fix
Run 'npm install fastqueue' and ensure the module name is lowercase.
TypeError: fastqueue_1.default is not a constructor
Using ES module import syntax on a CommonJS-only package.
fix
Replace 'import Queue from "fastqueue"' with 'const Queue = require("fastqueue")'.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
24
Resources
fastqueue — npm install fastqueue · libregistry