std-queue is an efficient FIFO queue for JavaScript/TypeScript that provides O(1) enqueue and dequeue operations. Version 0.1.6 is the latest stable release. Its key differentiator is an underlying linked list of subqueues (arrays of max size 1000) that avoids the O(n) shift cost of naive array-based queues and the memory overhead of pure linked lists. Designed for handling large amounts of data efficiently. The package ships TypeScript type definitions and has no external dependencies. It is actively maintained on GitHub.
npm install std-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a queue, adding elements in bulk with push(), peeking front and back, dequeuing with shift(), checking length, and clearing the queue.
Iterate manually: while (queue.length) { process(queue.shift()); }Use standard array methods after converting to an array if needed.
Check queue.length before calling shift() if undefined is unacceptable.
const arr = []; while (queue.length) arr.push(queue.shift());
Check queue.length before calling shift() or ensure queue is not empty.
Use default import: `import Queue from 'std-queue'`.
Use import syntax: `import Queue from 'std-queue'`.
No dependency data recorded yet.