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

matpgm

v1.0.2

Published

js scaffold for shaomingquan

Readme

matpgm

Design

focus on better dev experience, but not any other things.

  • light, only for server, can easily embed with fe code.
  • helper you auto load midwares for whole server or special controllers.
  • helper you auto load controllers.
  • hot reload. hot reload dev-server for koa1 & koa2. reload the midwares, controller and helper.
  • no babel, use the native directly, got rid of babel issues.

Usage

install matpgm global: install the cli tool.

npm install -g matpgm

init a project: mkdir and auto install the init dependencis.

matpgm init project_name

run dev server

npm run sdev

build the server to production version.

npm run sbuild

Detail

the project tree:

|____bin
| |____boot.js
|____server
| |____controller
| | |____index
| | | |____index.js
| |____helper
| | |____logger.js
| |____midware
| | |_____.js
| | |____index.js

a controller file can provide more than one controller, this is a controller.

module.exports = [{
    path: '/user/:user/', //this path same as koa-router
    method: ['get'], // the methods
    controller: async ctx => {
        var user = ctx.params.user
        ctx.body = 'you are read ' + user + '\'s page';
    }
}, {
    path: '/user2/:user/',
    method: ['get'],
    controller: async ctx => {
        var user = ctx.params.user
        ctx.body = 'this is second page of ' + user;
    }
}]

midware are async function(koa2) or generator(koa1).

helpers are others.

we can indicate specific controllers use a group of specific midwares. this is why midware/_.js exists.

module.exports = () => {
    var MAIN = ['index']; // all controllers use /midware/index.js as their midware

    var user = ['user']; // controller files under controller/user dir use user.js as their midware

    var calculator = ['calcu1', 'calcu2']; // controller files under controller/calculator dir use calcu1.js and calcu2.js as their midware.

    // exports the indication
    return {
        MAIN,
        user,
        calculator
    };
}

surport alias

we can import a file use absolute dir as below.

var logger = require('@s/helper/logger');

hooks

open the abilities of the app, we can do something in the very beginning of the app with onStart callback. also do something when the app booted.

// called when app init
function onStart (app, router) {

}

// called when app booted
function onBooted () {

}

try {
    require('../www')(onStart, onBooted);
} catch (e) {
    console.log(`there isn't www file, please run "npm run sbuild"`);
};

that's all and thanks for your suggests 😁 and I hope you can try it and add some issues for me 😜