data-queue
Queue and get data
Last updated 8 years ago by mkg20001 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install data-queue 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.3                                ...           latest (8 years ago)

3 Versions

  • 0.0.3                                ...           8 years ago
  • 0.0.2                                ...           9 years ago
  • 0.0.1                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |