Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@btmills/queue

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@btmills/queue

A performant queue data structure.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

JavaScript queue

This is a queue implementation for JavaScript with a convenient API that avoids use of the expensive (O(n)) Array.shift() operation.

Usage

var Queue = require('o1queue');

Create a new queue.

var q = new Queue();

Queue up some stuff.

q.enqueue('hello');
q.enqueue('world');

How big is it?

console.log(q.length); // 2

What's at the front?

console.log(q.peek()) // 'hello'

Remove some stuff.

while (q.length > 0) {
	console.log(q.dequeue()) // 'hello', 'world'
}

License

Copyright © 2015 Brandon Mills. All rights reserved. Licensed under the MIT License, the full text of which is available in LICENSE.

Keywords

FAQs

Package last updated on 26 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc