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

dp-node

v0.3.11

Published

Faster, cheaper, better web framework for Node.js

Downloads

98

Readme

dp-node

NPM Version NPM Downloads Dependency Status Linux Build Windows Build

Faster, cheaper, better web framework for Node.js, built on top of express.

Installation

$ npm install dp-node

Features

  • Rapid prototyping
  • async / await ready

Quick Start

Directory Structure

App
 ├─ controller
 │  ├─ foo
 │  │  ├─ bar
 │  │  │  └─ index.js
 │  │  └─ index.js
 │  ├─ bar
 │  └─ index.js
 ├─ model
 │  ├─ foo
 │  │  ├─ bar
 │  │  │  └─ index.js
 │  │  └─ index.js
 │  ├─ bar
 │  └─ index.js
 ├─ view
 │  ├─ foo
 │  │  ├─ foo.html
 │  │  └─ bar.html
 │  ├─ bar
 │  │  └─ baz.html
 │  └─ index.html
 └─ index.js

Controller

App/controller/foo/bar/index.js / http://localhost/foo/bar

module.exports = {
    async get() {
        /*
         *  `this` exports: {
         *     raw: {
         *        req: return express `req` object.
         *        res: return express `res` object.
         *     }
         *     model: return model accessor
         *     session: return model accessor
         *     params: (key, isURL)
         *     headers: (key)
         *     redirect: (url, statusCode)
         *     render: (view, params)
         *     finish: (body)
         *     finisher: {
         *        notfound: (body)
         *        invalid: (body)
         *        error: (body)
         *     }
         *     finishWithCode: (code, body)
         *  }
         */

        var arg1 = 10;
        var arg2 = 20;
        var res = this.model.foo.bar.add(arg1, arg2);  // == 30

        var params = {
            arg1: arg1,
            arg2: arg2,
            res: res
        };

        await this.render('foo/foo.html', params);
    }
};

Model

App/model/foo/bar/index.js / model.foo.bar

module.exports = {
    add(arg1, arg2) {
        /*
         *  `this` exports: {
         *     knex: (dsn)
         *     row: (query, params, dsn)
         *     rows: (query, params, dsn)
         *     execute: (query, params, dsn)
         *     tran: (blocks, dsn)
         *  }
         */

        return arg1 + arg2;
    }
};

Helper

App/helper/foo/bar/index.js / helper.foo.bar

module.exports = {
    add(arg1, arg2) {
        /*
         *  `this` exports: helpers
         */

        return arg1 + arg2;
    }
};

View

App/view/foo/foo.html / foo/foo.html

<p>{{arg1}} + {{arg2}} = <strong>{{res}}</strong></p>

Install

$ npm install dp-node

Dependencies

License

MIT