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

qwert

v1.1.9

Published

Node.js web application development framework built on top of Express

Readme

Qwert

Node.js web application development framework built on top of Express

Installation

  1. You can use Qwert starter github repository
    1. clone this repository on your local disk
    2. run npm install from command line
  2. Or use npm repository
    1. run npm install qwert from command line in your project directory

Configuration

example configuration:

const qwert = require("qwert");
const path = require("path");

qwert.config({
    root_dir: path.resolve("./src"), // Required
    controllers_dir: "./controllers", // optional, default is "controllers"
    models_dir: "./models", // optional, default is "models"
    middleware_dir: "./middleware", // optional, default is "middleware"
    views: {
        dir: "./views" // optional, default is "views"
    },
    port: 3000
});

qwert.boot();

According to this configuration, our directory structure will be

Qwert will scan these directories and read model, view, controller and middleware js files from there, You can read more about how to create these files below

Modules

Controller

Controllers must be located in controllers_dir directory ###How to create / Example create file in controllers directory, for example TestController.js Contents:

// file: controllers/TestController.js

const Controller = require("qwert/Controller");

module.exports = Controller(function($request, $response) {
    // some controller logic
}, {
    route: "/test"
});

this will create controller, that handles request on /test page Qwert injects services as controller function arguments by argument names, read about services

Parameters

Controller(fn, options)

  • fn (required) - Function - controller function, arguments are services
  • options (required) - Object - options of controller
    • route (required) - String - route that will be handled by controller, this parameter is
    • middleware - Array, String - middleware name or array of middleware names
    • method - String - method that will be handled (GET, POST, PUT, PATCH etc...), default is GET

ControllerGroup

Controller groups must be located in controllers_dir directory

###How to create / Example create file in controllers directory, for example TestControllerGroup.js Contents:

// file: controllers/TestControllerGroup.js

const ControllerGroup = require("qwert/ControllerGroup");

var group = ControllerGroup({
    route: "/home"
});

group.add(Controller(function($request, $response) {
    // Some controller logic
}, {
    route: "/main"
}));

module.exports = group;

This code will create ControllerGroup that handles requests on /home path Then added one controller which handles /home/main request, you can add as much controllers in group as needed

Parameters

ControllerGroup(options)

  • options (required) - Object - Controller group options
    • route (required) - String - base path of the controllers in this group
    • middleware - Array, String - middleware or list of middleware for this group

Model

Models must be located in models_dir

How to create / Example

create file in models directory, for example TestModel.js

Contents:

// file: models/TestModel.js

const Model = require("qwert/Model");

module.exports = Model("test", function(args) {
    this.getName = function() {
        return "George";
    }
});

this code creates model with name test model can be instantiated from middleware or controller by service $model Example code:

Controller(function($model, $param) {
    var userModel = $model("user"); // user is the name of model
    var user = userModel.getUser($param.get("id"));
    // some logic
}, {
    route: "/user/:id"
})

Parameters

Model(name, fn)

  • name (required) - String - the name of model, must be unique among all models
  • fn (required) - Function - model function, will be instantiated with new keyword

##Middleware Middleware must be located in middleware_dir directory

##How to create / Example Create file in middleware directory, for example TestMiddleware.js

Contents:

// file: middleware/TestMiddleware.js
const Middleware = require("qwert/Middleware");

module.exports = Middleware("testMiddleware", function($response, $post, $next) {
    if(!$post.has("id")) {
        $response.json({
            error: "You must provide id"
        });
    } else {
        $next();
    }
});

this code creates middleware with name testMiddleware testMiddleware can be used as middleware of Controller or ControllerGroup

Note: In case if you don't call $next function, you have to handle response

Parameters

Middleware(name, fn)

  • name (required) String - the name of middleware, must be unique among middlewares
  • fn (required) Function - middleware function

##Service injection

Services

Services are used in controller, model and middleware functions Service is passed to the function by name Example

function Test($post, $response) { // Parameter sequence and length has no matter
    $response.send($post.get("name"));
}
  • $request - express request object see docs
  • $response - express response object see docs
    • example: $response.send("Hello world");
  • $post - POST data of the request
    • example 1: $post.get("user_id"); // returns empty string if no user_id in post data
    • example 2: $post.all(); // returns object that contains all post data
  • $get - GET data of the request
  • $param - Parameters of the router
    • for example, router string: /user/:id, $param.get("id") will return the id
    • example: $get.get('user_id'); same as $post
  • $model - Model provider
  • $session - Session handler service
    • example var user = $model('User');
  • $next - used in Middleware, function that has to be called to continue request flow
  • $upload - Service for accepting uploaded files, files won't stored unless you accept them by this service, generally used in middleware
    • example $upload('file1').then(next); where file1 is form field and next is callback function
  • $files - files uploaded by Content-Type: multipart/form-data and received by $upload service
    • example var filename = $files.handler().get('file1').moveAutoName(__dirname+'../images/', true);