Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

18 Commits

Repository files navigation

queue

Simple JavaScript queue

browser support

Installation

$ component install ForbesLindesay/queue

API

queue()

Call queue() to create a new queue object:

varqueue=require('queue');varmyQueue=queue();

queue(mixin)

You can also use queue(mixin) as a mixin:

varqueue=require('queue');queue(myObject);

queue#enqueue(item)

Adds a new item to the queue, and returns the queue for chaining.

queue#dequeue()

Returns the next item in the queue, and remove it.

queue#peek()

Returns the next item in the queue, without removing it.

queue#isEmpty()

Returns true if there are no items left in the queue.

License

MIT

About

Simple JavaScript queue built from two stacks

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages