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

svcs

v0.2.1

Published

AMQP driven micro services for node.

Downloads

21

Readme

svcs Build Status

NPM NPM

This library aims to simplify building queue based services in nodejs using AMQP. It simplifies getting started and provides some out of the box monitoring / admin for these services.

Status

Don't use it in production, early adopters and hackers are welcome, the API is still in a state of flux as we work on evolving some of the core features.

API

To build a new service we just create the service and pass in our handler(s).

var svcs = require('svcs');
var container = svcs();

// override the default amqpUrl
var amqpUrl = process.env.AMQP_URL || config.amqp.url;

container.set('amqpUrl', amqpUrl);

function onErr(err) {
    console.warn('error processing message', err);
}

// add a route which will process messages for the given routing key
// the attribute :gatewayId will be replaced with * when passed to bindQueue
container.route('$gw.:gatewayId.events', {queue: 'gw_events', errorHandler: onErr}, function handler(msg){
    var gatewayId = msg.params.gatewayId;
});

Middleware

There are a couple of modules which can be added to the container.

JSON

This is a simple JSON decoder which will convert the payload of the incoming AMQP messages to JSON when the messages contentType is set to application/json.

container.use(svcs.json());

Routing Statistics

This will send per routingKey statistics to a statsd server using the increment function.

container.use(svcs.stats());

TODO

  • Add locals to enable connection pools to be tied in and available to the msg, this probably should be done by a middleware module later.
  • Need to rework configuration and decide where the defaults should live.
  • Need to review jobs as the api is pretty average at the moment.
  • More testing..

License

Copyright (c) 2013 Mark Wolfe released under the MIT license.