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

qhkj-noodle

v0.0.4

Published

a smart code generator for qhkj project.

Downloads

12

Readme

noodle

a smart code generator for qhkj project.

https://mozilla.github.io/nunjucks

介绍

编写设计文档

{
  "models": [
    {
      "name": "user",   // model名称
      "label": "用户",  // model文本名称
      "fields": [       // model数据库字段定义
        {
          "name": "id",         // 列名
          "type": "INTEGER",    // sequenlize列类型,[STRING, INTEGER, DATE, DATEONLY, TEXT, JSON, FLOAT, DOUBLE, BOOLEAN]
          "primaryKey": true,   // sequenlize model属性
          "autoIncrement": true,
          "allowNull": false,
          "unique": true,
          "comment": "'字段注释说明'",
          "faker": "`faker.internet.userName()`",   // model mock函数,使用faker工具
          "editable": true,     // 字段是否可修改, service代码以及管理后台中都会使用
          "listable": true,     // 字段是否在表格中列出, 管理后台中会使用
          "filterable": false,  // 字段是否可过滤, service代码以及管理后台中都会使用
          "required": true,     // 字段在新建和修改时是否可必填, service代码以及管理后台中都会使用
          "creatable": true     // 字段是否需要创建, 管理后台中会使用
        },
        ...
      ],
      "creatable": true,  // model是否支持创建, service代码以及管理后台中都会使用
      "editable": true,   // model是否可修改, service代码以及管理后台中都会使用
      "deletable": true,  // model是否可删除, service代码以及管理后台中都会使用
      "exportable": true, // 是否可导出excel, 管理后台中都使用
      "importable": false,// 是否能够导入excel, 管理后台中都使用
      "batchable": false  // 是否支持批量修改, service代码以及管理后台中都会使用
    },
    ...
  ],
  "services": [
    {
      "name": "user",                    // service 名称
      "namespace": "common",             // service 所在的namespace
      "models": ["user", "admin", ...]   // 需要在某个service中实现方法的model
    },
    ...
  ],
  "controllers": [
    {
      "name": "user",                    // controller 名称
      "models": ["user", "admin", ...],  // 需要在某个controller中实现方法的model 
      "api": {                      
        "base": "",                      // api前缀
        "version": "1.0.0",              // api版本号
        "groupValue": "user",            // api分组
        "groupLabel": "用户"             // api分组标题
      }
    },
    ...
  ]
}

example:

{
  "models": [
    {
      "name": "user",
      "label": "用户",
      "fields": [
        {
          "name": "id",
          "type": "INTEGER",
          "primaryKey": true,
          "autoIncrement": true,
          "allowNull": false,
          "unique": true,
          "faker": "`faker.internet.userName()`",
          "comment": "'字段说明'",
          "editable": true,
          "listable": true,
          "filterable": false,
          "required": true,
          "creatable": true
        },
        {
          "name": "name",
          "type": "INTEGER",
          "allowNull": false,
          "unique": true,
          "faker": "`faker.internet.userName()`",
          "comment": "'字段说明'",
          "editable": false,
          "listable": true,
          "filterable": true,
          "required": false,
          "creatable": true
        }
      ],
      "creatable": true,
      "editable": true,
      "deletable": true,
      "exportable": true,
      "importable": false,
      "batchable": false
    },
    {
      "name": "admin",
      "label": "管理员",
      "fields": [
        {
          "name": "id",
          "type": "INTEGER",
          "primaryKey": true,
          "autoIncrement": true,
          "allowNull": false,
          "unique": true,
          "faker": "`faker.internet.userName()`",
          "comment": "'字段说明'",
          "editable": true,
          "listable": true,
          "filterable": false,
          "required": true,
          "creatable": true
        },
        {
          "name": "name",
          "type": "INTEGER",
          "allowNull": false,
          "unique": true,
          "faker": "`faker.internet.userName()`",
          "comment": "'字段说明'",
          "editable": false,
          "listable": true,
          "filterable": true,
          "required": false,
          "creatable": true
        }
      ],
      "creatable": true,
      "editable": true,
      "deletable": true,
      "exportable": true,
      "importable": false,
      "batchable": false
    }
  ],
  "services": [
    {
      "name": "user",
      "namespace": "common",
      "models": ["user", "admin"]
    }
  ],
  "controllers": [
    {
      "name": "user",
      "models": ["user", "admin"],
      "api": {
        "base": "",
        "version": "1.0.0",
        "groupValue": "user",
        "groupLabel": "用户" 
      }
    }
  ]
}

生成egg-server代码

包含: model/* service/* controller/* router.js 以及接口文档注释

yarn noodle egg-server router ./example/design.json ./test -c
yarn noodle egg-server model ./example/design.json ./test -c
yarn noodle egg-server service ./example/design.json ./test -c
yarn noodle egg-server controller ./example/design.json ./test -c
yarn noodle egg-server all ./example/design.json ./test -c

规划功能

  • egg server 支持关系表类型的model
  • model支持枚举类型的处理
  • 设计文档中,model名称文本和描述分离
  • 管理后台中支持显示model中自动生成的createdAt