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 🙏

© 2024 – Pkg Stats / Ryan Hefner

amqp-prosumer

v4.0.0

Published

AMQP-based Consumer/Producer tool

Downloads

40

Readme

amqp-prosumer

AMQP-based Consumer/Producer tool

Node.js CI

Getting started

The tool provides --help information for you to get started. Please refer to the --help of each and every command for more details.

Use cases

  1. Publishing messages to an exchange
  2. Publishing messages directly to a queue
  3. Consuming messages "from an exchange"
  4. Consuming messages from a queue

Usage

Producer

Publishing messages to an exchange

In order to produce a series of messages to a topic exchange:

cat messages.txt | amqp-prosumer produce publish-to-exchange ExampleExchange

The example messages.txt file is a simple text-file, where each line forms a message which will be sent to the broker. To send a single message you can use:

echo "MessageToSend" | amqp-prosumer produce exchange ExampleExchange

NOTE: For convenience, commands have been provided with aliases - in the examples above produce exchange and produce publish-to-exchange are the very same command. Feel free to chose form which suits you the most.

Publishing messages to a queue

cat messages.txt | amqp-prosumer produce send-to-queue ExampleQueue

Consumer

Consuming messages from an exchange

In order to consume a message from an exchange

amqp-prosumer consume from-exchange ExampleExchange > output.txt

Consuming messages from a queue

amqp-prosumer consume from-queue ExampleQueue > output.txt

Node.JS and RabbitMQ support

The tool is transpiled for Node >=14. Each version is integration-tested with the latest RabbitMQ available at Docker Hub.

Limitations

Right now the tool provides support only for topic exchanges, and still, it does not utilize all the possibilities which this type of exchange gives (like setting the topic for the queue). Such missing functionality might me added in the future.

Debugging

If you'd like to know what's happening while the command is running, start it with the DEBUG="*" environment variable set. When you want to redirect the STDOUT of amqp-prosumer to another application or to a file, debug messages will not be passed.

DEBUG="*" amqp-prosumer consume from-queue ExampleQueue

About this project

Just for you to know: this is a side/training project which is used to exercise sorta functional programming in JavaScript. Sorta comes from the fact that JS is not really a language with FP core concepts included. There are open-source projects which attempt to implement FP for JS in form of frameworks, but this project intentionally avoids making use of them in order to serve the purpose of "training".