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 🙏

© 2026 – Pkg Stats / Ryan Hefner

dragonnodejs-restful

v3.0.1

Published

Bundle with services to develop RESTFul applications

Downloads

21

Readme

DragonNode.js RESTFul

Bundle with services to develop RESTFul applications

  • Logging with log4js, additional category "express" for the express log4js connector
  • Initialize Express with "body-parser" for JSON encoded request bodies
  • Initialize MongoDB connection with "mongoskin"
  • Add event emitter to the service container for all application events
  • Session services for login and check the session and route to logout
  • Validate input of the client with the "amanda" JSON schema validator

Installation

  • Add bundle to the "package.json":
{
    "dependencies": {
        "dragonnodejs-restful": "3.*"
    }
}
  • Execute "npm install"
  • Extend the configuration for the different environments, for example "./configs/development.js":
module.exports = {
    modules: {
        npm: {
            'dragonnodejs-restful': {
                log: {
                    appenders: [
                        { type: "console" }
                    ],
                    replaceConsole: true
                },
                app: { port: process.env.PORT || 80 },
                db: {
                    serverURLs: 'mongodb://127.0.0.1/app?auto_reconnect=true',
                    dbOptions: { safe: true }
                },
                event: {},
                session: { secret: 'secret' },
                validate: {
                    objectid: {
                        type: 'string',
                        length: 24,
                        required: true
                    }
                }
            }
        }
    }
};

Services

  • Node.js Libraries: events
  • NPM Libraries: amanda, bodyParser, cookieSession, express, log4js, mongoskin
  • Modules:
    • app: "express" application to define routes and connector functions "bodyParser" and "log4js" express logger
    • db: "mongoskin" database connection to the MongoDB
    • event: Event emitter of Node.js "events" to register observers and emit events
    • log: "log4js" default logger to log messages
    • session: ".check" connector function to validate the session, ".login" creates a session
    • validate: Validate input parameter with "amanda" and the configured schemas

Errorhandling

Cause of the problem the errorhandler must be the last connect functions, the bundle can't provide one. That's the reason why the project itself must define the errorhandler.

  • Add module "/modules/errorhandler.js":
"use strict";

/**
 * Errorhandler for the application server
 * @param moduleconfig
 * @param services
 */
module.exports = function (moduleconfig, services) {
    var app = services.app;

    app.use(function (err, req, res, next) {
        res.send({ err: err.message });
    });
};
  • Extend the configuration for the different environments, for example "./configs/development.js":
module.exports = {
    modules: {
        directory: {
            errorhandler: {}
        }
    }
};