npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

queue-port

v0.0.6

Published

A package to provide http interface for a basic queue based on actor model.

Readme

Queue-Port

Queue-Port is a library is a HTTP based server that can be used to manage queues based on Actor Model You can enqueue items to the queue you named and dequeue how many items you want from the queue immediately, indefinitely or after a certain time. Many clients can request to dequeue items from the queue at the same time. First come first served. Queues are FIFO (First In First Out), which means that the first item added to the queue will be the first one to be removed.

Installation

npm i -D queue-port

Usage

import * as queuePort from 'queue-port';

queuePort.start().then(() => {
  console.log('Queue-Port is running');
}).catch((err) => {
  console.error('Error starting Queue-Port:', err);
})

Default Port is 8765.

start function receives an object with the following properties:

  • port: Port to run the server. Default is 8765.
  • enableDashboardServer: Enable the dashboard server. Default is false.
  • dashboardServerPort: Port to run the dashboard server. Default is 8760.

If you enable the dashboard server, you can access it at http://localhost:8760, and check the queues and waiters on a basic web interface.

One you run the server, you will be able to do the following operations via HTTP requests:

  • Enqueue
  • Dequeue
  • Get Size

Enqueue

Example Request:

curl --location 'http://localhost:8765/enqueue/myqueue' \
--header 'Content-Type: application/json' \
--data '{
    "items": ["item1", "item2", "item3"]
}'

Response:

Enqueued

Dequeue

Example Request:

curl --location 'http://localhost:8765/dequeue/myqueue' \
--header 'Content-Type: application/json' \
--data '{
    "count": 2,
    "timeout": 0
}'

Response:

{
    "items": ["item1", "item2"]
}
  • count: Number of items to dequeue. Default is 1.
  • timeout: Time to wait for items to be available in the queue. Default is -1 (indefinite).
    • If set to -1 (or any negative number), it will wait INDEFINITELY for items to be available.
    • If set to 0, it will return an empty array IMMEDIATELY if no items are available. If there are items available, it will return them immediately.
    • If set to a positive number, it will wait for that many milliseconds before returning an empty array if no items are available.

Get Size

Example Request:

curl --location --request GET 'http://localhost:8765/size/myqueue'

Response:

{
    "size": 1
}