A lightweight FIFO queue data structure implementation for browser and Node.js. Version 0.1.1 provides enqueue, dequeue, first, isEmpty, size, empty methods and an iterator. Supports bounded capacity with optional initial capacity. Minimal dependencies, simple API. No TypeScript types. Suitable for small projects needing a basic queue.
npm install queue-adtNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic Queue operations: enqueue, first, isEmpty, size, dequeue, iterator, and empty.
Assign result to a variable: const item = queue.dequeue();
Do not assume enqueue returns nothing; use return value if needed.
Pass only non-negative integers: new Queue(10);
Use queue.iterator (not queue.iterator()).
Use queue.iterator (no parentheses) to get the iterator object.
Ensure queue exists and has elements before calling first(). Check version.
Use new Queue() without arguments for infinite capacity, or increase initialCapacity.
Use import Queue from 'queue-adt' in ESM context, or use a bundler that handles CommonJS.
No dependency data recorded yet.