Skip to content

ForbesLindesay/queue

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:

var queue = require('queue');
var myQueue = queue();

queue(mixin)

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

var queue = 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

License

Stars

Watchers

Forks

Packages

No packages published