elegant-queue
JSON →elegant-queue (v1.0.9) is a high-performance queue implementation for JavaScript and TypeScript that uses a linked list of fixed-size arrays (circular buffers) to achieve O(1) enqueue and dequeue operations. Unlike native array-based queues that suffer from O(n) shifting, this package maintains constant-time operations even with millions of elements. It ships TypeScript definitions, supports both CommonJS and ES Modules, and offers a simple API: enqueue, dequeue, peek, clear, size, and isEmpty. The default internal array size is 4096, but can be configured. Suitable for Node.js and browser environments. Stable release, no recent updates.
Resources
packageelegant-queue ↗