A high-performance Queue data structure with O(1) enqueue, dequeue, and access operations. Version 2.6.0 is stable and actively maintained as part of the data-structure-typed family. Unlike JavaScript's native Array (O(n) shift) and other queues (O(n) access), Queue Typed provides constant-time operations across all queue operations. Ships TypeScript definitions. Recommended for large-scale FIFO processing where performance matters.
npm install queue-typedNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a queue, enqueue 1000 numbers, dequeue them, then access by index to demonstrate O(1) performance.
Use queue.dequeue() to remove and return the front element.
new Queue([1,2,3]) results in queue with front=1, rear=3.
Use `queue.enqueue(item)` instead.
Use `const { Queue } = require('queue-typed')`Use ES module imports or downgrade to v2.x if CommonJS is required.
import { Queue } from 'queue-typed'queue.enqueue(item)
const { Queue } = require('queue-typed')Use import statement or downgrade to 2.x
Set 'moduleResolution': 'node16' in tsconfig.json
No dependency data recorded yet.