🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

data-queue

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-queue

Queue and get data

latest
Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
486
-37.21%
Maintainers
1
Weekly downloads
 
Created
Source

data-queue

Queue and get data

Usage

const Queue = require("data-queue")

const queue = Queue() //create without new

queue.get((err, data) => { //this will wait for .append()/.prepend() or .error() calls
  console.log(data)
  queue.get((err, data) => {
    if (err) throw err //Throw the error
  })
})

queue.append("Hi there")

queue.error(new Error("Something fatal happened"))

queue.append("What's up?") //This won't append the data. instead it will return the error

console.log(queue.height()) //This gets the number of items in the queue

Keywords

queue

FAQs

Package last updated on 14 Nov 2017

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