The JavaScript blog.


npm libraries node webapps modules deployment

Node Roundup: Rozu, environmentalist, package.js

Posted on .


Rozu (GitHub: avoidwork/rozu, License: BSD-3-Clause, npm: rozu) by Jason Mulligan is a webhook API server that uses io.js or Node, MongoDB, and Redis. MongoDB is used for persistence, and the Redis pub/sub API is used for inbound events.

It's built with tenso for the REST API, and keigai for data storage with MongoDB. It can both send and receive webhook events. To send events, you make a POST to /send with a logged in user, and to make it receive a JSON payload you use /receive. Receiving events uses a token, so it's pretty easy to use it with sites like GitHub.

Once you've installed it you can create an account by making a GET request to /register. If you visit / (whether signed in or not) you'll get a list of API methods.


Alexander Christie has written a blog post about dealing with environmental variables in web applications. Rather than having a list of variables that you have to remember to set on every server for each dependency, his solution is based on using a Node command-line tool called environmentalist (GitHub: AJCStriker/Environmentalist, License: MIT, npm: environmentalist).

The problem is that we use several different packages to build our application, taking full advantage of the awesome NPM private modules that were recently released. The problem was that it has become increasingly hard to keep track of what environmental variables were required to make the project function, or were just generally available, because they were all being accessed at different levels of the applications dependency tree.

With environmentalist, you define a JSON file that specifies each environmental variable:

    "description": "Used to compute the password hash of users",
    "default": "ABCDEFGHIJKLMOP",
    "required": true

Because you can include a description it's already useful because in my experience most people export (or heroku config:set) and forget about it later. I also like the fact you can set a default value and the required state. The name is the only required field, so if the values are obvious and self-documenting then you can keep things simple.

When you run environmentalist in the command-line, you'll see a table that shows all of the environmental variables in the current package and its dependencies, which means you can construct projects from submodules with environmentalist JSON files and it'll dig them all out.


If you've created a Node application but you want to support plugins, what to do you? package.js (GitHub: s-a/package.js, License: MIT and GPL, npm: package.js) by Stephan Ahlf is designed to allow you to open up your project to plugin developers through npm or other package managers.

It allows you to load modules from a set of paths, and then ensure each module has a property (expectedPackageIdentifier) in its package.json. It's a small module with unit tests and an example in the readme.


reviews services webapps


Posted on .

ExceptionHub by Agile Productions is a new web service that tracks JavaScript exceptions. It uses a small (8.6
KB) JavaScript include that catches uncaught exceptions on your page and
then transparently sends them to the service. It can alert you by email,
or you can view the web interface. Each project also has an RSS feed.

You can view a summary of each error or a stack trace. ExceptionHub
groups similar exceptions like this:


ExceptionHub is a commercial service, but there is a free trial. Plans
start at \$5.00 a month for 3 projects, and all plans have unlimited

Supported Browsers

From what I can gather, Safari, Chrome, Firefox and IE are supported.
Opera is not. Firefox and IE support is through an onerror
handler. Chrome and Safari use a custom solution where all events are
wrapped in a closure.

Ryan Stout explains how it works in Improving JavaScript


Exception reporting systems can be useful for monitoring production
environments. I have a homegrown solution for my commercial web apps,
but I can understand why people use services like
Hoptoad. ExceptionHub is a little bit more niche because it targets JavaScript.

The usefulness of this is debatable. There are cases when duplicating
JavaScript bugs is difficult -- a customer reports a bug and you can't
quite reproduce it. ExceptionHub would at least alert you with the best
stack trace it can generate.

I've had good support from Agile Productions while testing the service,
and they've actually fixed a few minor niggles that I ran into. It's a
young service so I expect the user interface will evolve somewhat --
it's not bad by any means but it has that new Rails app feel.


If your site depends heavily on JavaScript, ExceptionHub could be
incredibly useful. Many sites fundamentally depend on complex
client-side logic, so Agile Productions could be onto a winning product
if they keep developing the concept.

I encourage you to check out the free trial and see what you think.