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

rmqcat

v0.0.3

Published

netcat-like tool for sending data through RabbitMQ

Downloads

4

Readme

rmqcat

A netcat-like tool for sending things through RabbitMQ.

Installation

npm install -g rmqcat
rmqcat --help

Use

rmqcat has two modes of use, one-way and two-way ("duplex"). Duplex corresponds more or less to how netcat works, that is, it establishes a socket-like connection with a server ('listener') on one side and a client on the other, which can speak back and forth.

One-way (simplex) either relays stdin to a RabbitMQ queue, or from a RabbitMQ queue to stdout. Sending to a queue doesn't wait for a receiver; receiving from a queue waits for data in the queue.

Common to both modes

The option --url can be used to address a specific RabbitMQ server, and to provide connection parameters -- see the amqplib documentation. By default a RabbitMQ server on localhost is assumed, so you will probably want to supply --url in practice.

The option -D will make rmqcat output a bit of debug information to stderr.

The option --help, if present at all, will make rmqcat output a usage message to stderr then exit.

Duplex

# Start a listener that will put whatever it gets in a file
rmqcat -l > recv.txt

# Send a file to the listener
rmqcat < send.txt

rmqcat used this way will keep a connection open until it gets end-of-file, so you can use it to "chat" back and forth, similar to netcat.

A client (i.e., without -l) will buffer input until its connection is accepted by a listener.

The option -k in combination with -l will keep the listener accepting successive connections. Otherwise it will exit once the first connection closes.

The option -e or --exec causes rmqcat to spawn a child process using the argument following and redirect stdin and stdout of that process to the queue. For example,

rmqcat -l --exec "grep -n foo"

If the option -k is used in combination with -e, the child process will be run for each connection made. In a client, the process is run once the connection is accepted.

The option --service has a role similar to a TCP port number. It names a queue to be used by clients and listeners to establish connections. The default is arbitrarily "rmqcat".

One-way

# Send a file to a queue
rmqcat --send bobbins < bobbins.iso

# Save the file in a queue and output the SHA1 sum
rmqcat --recv bobbins | tee bobbins.iso | shasum

The string following either --send or --recv names a queue that will hold the data in transit. More than one file of data can be present in the queue; rmqcat --recv <queue> will read a single file before exiting, or wait if there is no data yet.