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

node-well

v1.0.0

Published

A well to send JSON data into

Downloads

5

Readme

Well

Well is a fast, lightweight service that accepts JSON documents and saves them into one or more data-stores.
It's storage-agnostic and can be expanded with drivers for (virtually) any data-storage.
Currently drivers for MongoDB and Redis have been implemented, but more are on their way: next ones planned are CSV and RethinkDB.

Getting Started

First things first, install it:

$ sudo npm install -g node-well

Then configure buckets and the well server:

$ sudo touch /etc/well.conf

Here's a simple configuration, using the MongoDB driver:

{
    "PORT": 6666,
    "BUCKETS":
    {
        "default":
        {
            "DRIVER": "mongodb",
            "HOST": "localhost",
            "PORT": 27017,
            "DB":   "DefaultBucket"
        }
    }
}

But you can add as many buckets as needed:

{
    "PORT": 6666,
    "BUCKETS":
    {
        "default":
        {
            "DRIVER": "mongodb",
            "HOST": "localhost",
            "PORT": 27017,
            "DB":   "DefaultBucket"
        },

        "second":
        {
            "DRIVER": "redis",
            "HOST": "10.0.0.123",
            "PORT": 6379,
            "DB":   2
        },

        "third":
        {
            "DRIVER": "mongodb",
            "HOST": "10.0.0.222",
            "PORT": 27017,
            "DB":   "ThirdBucket"
        }
    }
}

The only rule of the well configuration (club) is "You must have the default bucket configured".
That's all.

Once configured you can start it:

$ sudo well

Examples

Provided it's configured to listen on port 6666 well will accept incoming POST requests at the following paths:

http://localhost:6666/well/push
http://localhost:6666/well/push/<BUCKET>

First one pushes to the default bucket while the second one to a specific one.
This is a typical request, posting a simple JSON to the server:

curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' localhost:6666/well/push/mybucket

Content-Type must be "application/json".
After posting it the previous request is simply routed to the data-storage instance configured as "mybucket" in /etc/well.conf.
Data POST-ed to http://localhost:6666/well/push will be routed to the default bucket instead.

Here's the answer returned by well when the POST is successful:

{"status":"ok"}

Drivers

Writing a driver is as simple as implementing the following function and exporting it in a module:

module.exports =
{  save: function(data, conf, log, callback) {}  }
  • 'data' is a Javascript object, required to be saved by the driver.
  • 'conf' is a Javascript object, containing all the relevant configurations needed by the driver to know how and where to save the data.
  • 'log' is a Javascript object exposing three methods to be used for logging purposes: 'info', 'debug' and 'error'.
  • 'callback' is a Node-style callback to be called once the data have been saved. It takes one or zero arguments: if and only if an error occurred the only argument must be populated with that one error.

License

Copyright (c) 2015 Nicola Orritos
Licensed under the MIT license.