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

delicate

v0.0.5

Published

一套基于`koa`的轻量级`mvc`框架,旨在让基于 node 的 Web`接口`开发变得更便捷,更灵活,更高效

Downloads

1

Readme

DelicateJS· GitHub license NPM version

一套基于koa的轻量级mvc框架,旨在让基于 node 的 Web接口开发变得更便捷,更灵活,更高效

💀 注意

  • 不推荐使用该框架进行服务端模板渲染,如果实在要实现服务端渲染,推荐基于 react 的同构框架next.js

  • 该框架注重于基于 api 的后端业务

Setup

$ cd example
$ node index.js

访问 http://localhost:3001/ more>

Deployment

使用 pm2 进行项目的部署服务

更新日志

  • 服务端返回形式

    • 正常返回
    //例如返回json格式的数据
    this.ctx.set('Content-Type', 'text/json');
    this.ctx.body = {};
    • 模板返回
    //指定模板的路径和模板需要渲染的数据[数组]
    this.view(templatePath, templateData);
    • 重定向
    //重定向到路由为'/'的页面
    this.redirect('/');
  • 请求方式检测
//core  MY_Controller
module.exports = class extends DJ_Controller {
  constructor(ctx) {
    super(ctx);
    this.MethodNotAllowed(() => {
      this.ctx.status = 405;
      this.ctx.body = 'Method Not Allowed';
    });
  }
};

//controllers
//目前支持请求方式 'get', 'post', 'delete', 'head', 'options', 'put', 'patch'
module.exports = class extends MY_Controller {
  async delete() {
    /*
     * 指定当前接受的请求方式
     * 如果请求方式不是delete,会执行this.MethodNotAllowed的回调方法
     * 如果不指定method,也可以直接写业务,但是这个会任何请求方式都会命中该路由  
     */

    //指定单个请求方式
    await this.method.delete();

    //指定多个请求方式
    await this.method('delete', 'post');

    //指定不同的请求方式的业务代码
    //必须要先指定所有可能的请求方式
    //await this.method('post', 'delete')
    this.method.post(async () => {
      //post请求方式的业务代码
    });

    this.method.delete(async () => {
      //delete请求方式的业务代码
    });

    //编写业务代码
    //更多查看最佳实践delicatejs-example
  }
};

More

更多使用姿势,请参考example

License

MIT