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

jackrabbitjs

v1.3.1

Published

[![npm version](https://badge.fury.io/js/jackrabbitjs.svg)](https://badge.fury.io/js/jackrabbitjs) [![Build Status](https://travis-ci.org/acmadden/jackrabbitjs.svg?branch=master)](https://travis-ci.org/acmadden/jackrabbitjs)

Downloads

9

Readme

JackrabbitJS

npm version Build Status

JackrabbitJS is a amqplib wrapper built to hide the complexities of messaging protocols. It was built for smaller to midlevel projects that need a simple messaging api that works.

Usage

Installing JackrabbitJS

npm install jackrabbitjs --save

Consumer:

const jackrabbit = require('jackrabbitjs');

const credentials = {
    uri: 'server-uri',
    user: 'jack',
    password: 'rabbitjs'
};

let options = {
    queue: 't',
    ack: true
};

jackrabbit.connect(credentials, (err, connection) => {
    jackrabbit.consume(connection, options, (err, message) => {
        console.log(message.content.toString());
    });
});

Producer:

const jackrabbit = require('jackrabbitjs');

const credentials = {
    uri: 'server-uri',
    user: 'jack',
    password: 'rabbitjs'
};

let options = {
    queue: 't',
    payload: 'ello',
    timeout: 3000
};

jackrabbit.connect(credentials, (err, connection) => {
    if (err) {
        process.exit(1);
    }
    jackrabbit.produce(connection, options);
});

RPC-Consumer:

const jackrabbit = require('jackrabbitjs');

const credentials = {
    uri: 'server-uri',
    user: 'jack',
    password: 'rabbitjs'
};

let options = {
    queue: 't',
    rpc: true
};

jackrabbit.connect(credentials, (err, connection) => {
    jackrabbit.consume(connection, options, (e, message, channel) => {
        if(channel) {
            jackrabbit.reply(message.properties.replyTo, message.properties.correlationId, channel, 'jackrabbitjs');
        }
    });
});

RPC-Producer:

const jackrabbit = require('jackrabbitjs');

const credentials = {
    uri: 'server-uri',
    user: 'jack',
    password: 'rabbitjs'
};

let options = {
    queue: 't',
    payload: 'ello',
    rpc: true,
    exclusive: true,
    timeout: 3000
};

jackrabbit.connect(credentials, (err, connection) => {
    jackrabbit.produce(connection, options, (err, reply) => {
        // do stuff with the message
    });
});

Options:

uri: [the RabbitMQ server uri]
user: If the user is specified in the uri, this is not needed.
password: If the password is specified in the uri, this is not needed.
payload: [the payload sent to the consumer]
function: [function call sent to the consumer]
exclusive: defaults to false,
rpc: defaults to false,
ack: defaults to true,
persistent: defaults to false,
durable: defaults to false,
prefetch: defaults to 1,
timeout: defaults to -1. The connection must be closed manually if a timeout is not specified.

Roadmap

version 1.1

  • [x] basic one way publish
  • [x] basic one way consume

version 1.2

  • [x] consume with acknowledgement and reply
  • [x] publish receives acknowledgement and reply

version 1.3

  • [x] refactor to simplify api

version 1.4

  • [ ] broadcast to multiple consumers

miscellaneous

  • [ ] documentation