@iter-tools/queue

A simple es6 linked FIFO queue in the pattern of es6 Map
and Set
. Includes typescript libdefs. Suitable for node or browser environments.
Usage
const Queue = require('@iter-tools/queue');
const q = new Queue([1, 2, 3]);
q.push(4);
[...q];
q.size;
q.shift();
q.shift();
q.shift();
q.shift();
q.size;
q.shift();
API
class Queue<T> {
constructor(values?: Iterable<T>);
static isQueue(inst);
size: number;
peek(): T;
shift(): T;
push(value: T);
forEach(cb: (T) => any, thisArg: any);
[Symbol.iterator](): IterableIterator<T>;
}