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

clwy-express-generator

v5.2.4

Published

Express' application generator

Readme

Express Logo

clwy-express-generator:Express 应用程序生成器

此项目基于 express-generator 分叉而来,并新增了一些功能特性。

功能特性

  • 🚀 ES6 支持:代码更现代简洁。
  • 🔀 路由拆分:独立文件,便于管理维护。
  • 🗄️ ORM 支持:支持 Sequelize 或 Prisma ORM。
  • 📁 中间件模块化:新增文件夹存放中间件。
  • 🔧 增加环境变量配置:多环境管理更便捷。
  • 🔄 集成 nodemon:开发时自动重启服务。
  • 🌐 集成 CORS:允许跨域请求。
  • 📄 新增 README.md:包含项目简介和基本功能说明。
  • 📦 内置配置:默认包含.prettierrc(代码格式化)和.gitignore(文件忽略)。

快速开始

基础使用

使用express最快的方式是利用可执行文件express(1)来生成一个应用,如下所示:

创建应用:

$ npx clwy-express-generator --view=ejs --es6 es6-demo
# 或:npx clwy-express-generator -v=ejs --es6 es6-demo
$ cd es6-demo

安装依赖:

$ npm install

http://localhost:3000/ 启动您的 Express.js 应用:

$ npm start

使用 ORM

使用数据库

安装好 Docker 并启动后:

$ docker-compose up -d

默认将启动 MySQL 数据库,PostgreSQL 和 Redis 配置已在 docker-compose.yml 中,请根据需求取消注释。

使用 Sequelize

创建应用:

$ npx clwy-express-generator --view=ejs --orm=sequelize --es6 es6-sequelize-demo
$ cd es6-sequelize-demo
$ npm i

根据需求安装数据库引擎:

$ npm install --save mysql2 # MySQL
$ npm install --save pg pg-hstore # Postgres

使用 clwy-sequelize-cli

项目已默认集成了clwy-sequelize-cli,使用以下命令会生成 ES6 风格的模型、迁移和种子文件。

生成模型和迁移文件:

$ npx sequelize model:generate --name Article --attributes title:string,content:text

生成种子文件:

$ npx sequelize seed:generate --name article

使用 Prisma

创建应用:

$ npx clwy-express-generator --view=ejs --orm=prisma --es6 es6-prisma-demo
$ cd es6-prisma-demo
$ npm i

初始化数据库客户端:

$ npx prisma generate

命令行选项

此生成器还可以通过以下命令行标志进行进一步配置。

    --version        输出版本号
-v, --view <engine>  添加视图引擎 <engine> 支持 (dust|ejs|hbs|hjs|pug|twig|vash|api)(默认为 ejs)
    --no-view        使用静态html而不是视图引擎
-o, --orm <orm>      添加 ORM <orm> 支持 (sequelize|prisma)
-c, --css <engine>   添加样式表引擎 <engine> 支持 (less|stylus|compass|sass)(默认为纯 css)
    --git            添加 .gitignore 文件
    --es6            生成 ES6 代码和模块类型项目(需要Node 22.x或更高版本)
-f, --force          强制在非空目录上操作
-h, --help           输出使用信息

clwy-express-generator: Express Application Generator

This project is forked from express-generator with additional features.

Features

  • 🚀 ES6 Support: More modern and concise code.
  • 🔀 Route Splitting: Independent files for easier management and maintenance.
  • 🗄️ ORM Support: Supports Prisma or Sequelize ORM.
  • 📁 Modular Middleware: New folder for storing middleware.
  • 🔧 Enhanced Environment Variable Configuration: More convenient multi-environment management.
  • 🔄 Integrated Nodemon: Automatic service restart during development.
  • 🌐 Integrated CORS: Allows cross-origin requests.
  • 📄 Added README.md: Contains project introduction and basic feature descriptions.
  • 📦 Built-in Configuration: Includes .prettierrc (code formatting) and .gitignore (file ignore) by default.

Quick Start

Basic Usage

The fastest way to create an Express application is by using the executable express(1) to generate an app, as shown below:

Create the application:

$ npx clwy-express-generator --view=ejs --es6 es6-demo
$ cd es6-demo

Install dependencies:

$ npm install

Start your Express.js app at http://localhost:3000/:

$ npm start

Using ORM

Using a Database

After installing and starting Docker:

$ docker-compose up -d

By default, the MySQL database will be started. PostgreSQL and Redis configurations are already included in docker-compose.yml; please uncomment them as needed.

Using Sequelize

Create the application:

$ npx clwy-express-generator --view=ejs --orm=sequelize --es6 es6-sequelize-demo
$ cd es6-sequelize-demo
$ npm i

Install the database engine as needed:

$ npm install --save mysql2 # MySQL
$ npm install --save pg pg-hstore # Postgres

Using clwy-sequelize-cli

The project has clwy-sequelize-cli integrated by default. Using the following commands will generate ES6-style models, migrations, and seed files.

Generate model and migration files:

$ npx sequelize model:generate --name Article --attributes title:string,content:text

Generate seed file:

$ npx sequelize seed:generate --name article

Using Prisma

Create the application:

$ npx clwy-express-generator --view=ejs --orm=prisma --es6 es6-prisma-demo
# or: npx clwy-express-generator -v=ejs -o=prisma --es6 es6-prisma-demo

$ cd es6-prisma-demo
$ npm i

Initialize the database client:

$ npx prisma generate

Command Line Options

This generator can be further configured with the following command line flags.

    --version        Output the version number
-v, --view <engine>  Add view engine <engine> support (dust|ejs|hbs|hjs|pug|twig|vash|api) (defaults to ejs)
    --no-view        Use static HTML instead of a view engine
-o, --orm <orm>      Add ORM <orm> support (sequelize|prisma)
-c, --css <engine>   Add stylesheet engine <engine> support (less|stylus|compass|sass) (defaults to plain css)
    --git            Add .gitignore file
    --es6            Generate ES6 code and module type project (requires Node 22.x or higher)
-f, --force          Force operation on non-empty directory
-h, --help           Output usage information

License

MIT