Need private packages and team management tools?Check out npm Teams »

@mrnkr/simple-queue

1.0.5 • Public • Published

simple-queue

Introduction

The smallest possible implementation of a queue. Need simplicity? Here it is. 100% code coverage in tests, all alternatives I could think of are taken into consideration as well. Hence, it is as robust as it can be... (that statement may backfire, be gentle 😅)

Quick start

The specification is the following:

export interface Queue<T> {
 
  enqueue(val: T): void;
  next(): T | undefined;
 
  length: number;
 
}

All methods do exactly what they are meant to do in the provided implementation (QueueImpl). You may reimplement this interface, extend it, do as you wish, really.

Keywords

none

Install

npm i @mrnkr/simple-queue

DownloadsWeekly Downloads

7

Version

1.0.5

License

MIT

Unpacked Size

12.8 kB

Total Files

22

Last publish

Collaborators

  • avatar