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

chanho

v0.0.1

Published

Hono + MySQL + Knex + Zod + javascript 多模块mvc框架

Readme

Chanho

Chanho(禅火:以禅心驭火焰) 是一个基于 Hono+Knex+MySQL+Zod+Vue3 构建的轻量级 MVC 框架,遵循 JavaScript 优先原则。它体现了函数式编程的概念,提供了卓越的性能、清晰的代码和易于遵循的过程,确保了高可维护性。

🌟 开发友好,推崇JS优先。适合全栈开发者,独立而高效、优雅的代码、极致的性能、稳定的生产实践,灵活强大。

特点

  • 基于 Hono 构建
  • 基于 EMSA 语法
  • 模块化设计
    • 多模块化路由
    • 模块化 views
    • 模块化 controllers
    • 模块化 services
  • 插件式架构
  • 灵活强大
  • 缓存支持

依赖环境

Node.js v22.18.0
pm2 v6.0.8

约定优于配置

|- app
    |- helper      //工具函数
    |- common      //通用函数库(分页, 文件上传, 加密, 解密, 校验, 转换, 等)
    |- extend      //第三方组件扩展(hono和第三方组件的扩展)
    |- middleware  //全局中间件
    |- modules     //多模块mvc
        |- module1 
            |- controller 
            |- service 
            |- model  //数据库模型 (可选)
            |- view 
            |- router.js 
        |- module2 
            |- controller 
            |- service 
            |- view 
            |- router.js
    |- plugin //插件
        |- plus-module1 
            |- controller 
            |- service 
            |- view 
            |- router.js 
        |- module2 
            |- controller 
            |- service 
            |- view 
            |- router.js
|- config 
|- public
|- index.js
|-.env.dev
|-.env.prd

初始化过程

  • 初始化
  • 加载配置
  • 加载模块
    • 加载路由
  • 加载扩展
  • 加载插件
    • 加载路由
  • beforeStart() 钩子用于将数据库中的配置合并到配置中
  • run() 启动服务器

功能亮点

  • 配置文件
  • 多模块 MVC 结构
  • 插件 MVC 支持
  • CORS 跨域配置支持
  • 多数据库支持 (PostgreSQL、MySQL / MariaDB、SQLite3、Oracle Database、MSSQL)
  • 路由控制
  • Art-template 模板引擎
  • 静态资源管理
  • Cookie 处理
  • 日志功能

运行

import Chanho from "chanho";
const app = new Chanho()
await app.init()
app.start()

开发模板 (推荐)

    1. 克隆项目
git clone https://github.com/mingkong2023/chanhox.git
cd chanhox
    1. 安装依赖
npm install
    1. 配置数据库

.env 文件中配置 MySQL 数据库连接信息。

# .env
NODE_ENV=development
PORT=3000

DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=yourpassword
DB_NAME=chanho_db

# JWT Secret (可选)
JWT_SECRET=your_jwt_secret_key
    1. 初始化数据库
npm run migrate
npm run seed
    1. 运行项目
npm run dev