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

pino-mq

v1.0.1

Published

Pinno Transport over MQ

Downloads

360

Readme

Build Status

pino-mq

Pino-mq will take all messages received on process.stdin and send them over a message bus using JSON serialization;

Installation

npm install -g pino-mq

Quick Example

node app.js | pino-mq -u "amqp://guest:guest@localhost/" -q "pino-logs"

Command line switches

  • --type (-t): MQ type of transport to be used (default 'RABBITMQ')
  • --uri (-u): uri for connecting to MQ broker
  • --queue (-q): queue to be used for sending messages
  • --queuePattern (-qp): queuePattern to be used for sending messages
  • --fields (-f): comma separated fields for filtering messages before sending
  • --exchange (-e): exchange name to be used in case of rabbitmq transport
  • --config (-c): path to config file (JSON); switches take precedence
  • --generateConfig (-g): create pino-mq.json config file with default options
  • --help (-h): display help
  • --version (-v): display version

Configuration JSON File

by using --generateConfig it will create pino-mq.json file with all available configuration options; queueMap option is available only in configuration json file;

{
 "type": "RABBITMQ",
 "uri": "amqp://guest:guest@localhost/",
 "exchange": "",
 "queue": "pino-mq",
 "queuePattern": null,
 "queueMap": null,
 "fields": []
}

Broker connection

  • uri option will follow URI specification for defining connection to a host:

    <protocol>://[user[:password]@]host[:port][/path][?query]

    where protocol, path and fragment will be specific for each type of broker

Queues configuration

queue configuration has a priority in defining behaviour for pino-mq; if more than one is specified, configuration will take this precedence:

  1. queue all messages will be sent on this queue
  2. queuePattern all messages will be sent on queue based on their message level; corespondig queue will be <queuePattern><messageLevel>:
    • ex:
      queuePattern: 'pino-mq-
      message:
      {"pid":25793,"hostname":"localhost.localdomain","level":50,"time":1503252634289,"msg":"msg3","v":1}
      will be routed to pino-mq-50 queue;
  3. queueMap option allows you to specify specific queues based on their message level:
    queueMap: {
      default: 'pino-mq-default',
      '30': 'infoMessages',
      '40': 'warnMessages',
      '50': 'errorMessages', 
    }
    all info messages will be sent on infoMessages queue, warn on warnMessages and errors on errorMessages;
    • default option will match any other messages where their level will not match anything in the map; this key is mandatory;

RabbitMQ specific options

For RabbitMQ type there is an extra option:

  • --exchange: if you want to use a specific exchange for your queues or you want to use topics instead of queues than you have to pass it to pino-mq configuration; topics are a more powerful distribution mechanism than queues and explaining it is beyond the scope of this module (RabbitMQ Topics tutorial)

Fields filtering

in case is needed to filter log messages fields you can use fields option:

  • from command line:
    • --fields "time,level,msg"
  • from configuration json file:
    • "fields":["time","level","msg"]

TODO

  • [ ] add Redis transport
  • [ ] add NATS transport
  • [ ] add documentation on how to use this module as dependency

LICENSE

MIT License