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

faster-auto

v0.0.9

Published

A fast and lightweight framework for building RESTful APIs with Sequelize and Node.js. Supports automatic model loading, flexible query APIs, and built-in Swagger documentation.

Readme

🚀 faster-auto

一款基于 Node.js + Sequelize 的自动化 API 快速构建工具,支持从模型文件(JSON Schema / DBML / SQL DDL)中自动生成 RESTful 接口和 Swagger 文档。

✨ 特性

  • ⚡ 仅需一行代码,快速启动 Web API
  • 📦 自动加载模型文件(支持 .json / .dbml / .sql
  • 🔄 自动生成 CRUD 接口
  • 📚 自动生成 Swagger 文档(支持调试)
  • 🔧 支持模型扩展:字段校验、默认值、主键、自增、外键、唯一索引等
  • 🧩 Sequelize 模型自动导出,支持手动操作或关联
  • 🛠️ 支持模型热更新(开发模式)
  • 🌐 内置 Swagger UI + Redoc 文档浏览

📦 安装

npm install faster-auto

npx faster-auto my-app

🚀 快速开始

项目目录结构如下:

my-app/
├── models/
│   ├── user.json
│   ├── post.dbml
│   └── comment.sql
└── index.js

启动服务:

// index.js
import { Faster, Models } from 'faster-auto';

const app = Faster({
  modelDir: './models',
  db: {
    dialect: 'sqlite',
    storage: ':memory:' // 也可支持 mysql, postgres 等
  }
});

app.listen(3000);

📁 模型格式支持

1. JSON Schema(推荐)

{
  "title": "User",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "x-primaryKey": true,
      "x-autoIncrement": true,
      "x-snowflake": true
    },
    "calss":{
      "type": "string",
      "x-references": {
        "model": "Class",
        "key": "id"
      }
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "default": "now"
    }
  },
  "required": ["email"]
}

2. DBML

Table tb_faster_auto_user {
  id int [pk, increment]
  email varchar [not null, unique]
  createdAt timestamp [not null]
  updatedAt timestamp [not null]
}

3. SQL DDL

CREATE TABLE tb_faster_auto_user (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  class varchar(255) COLLATE "pg_catalog"."default",
  email VARCHAR(255) NOT NULL UNIQUE,
  "createdAt" timestamptz(6) NOT NULL,
  "updatedAt" timestamptz(6) NOT NULL,

  CONSTRAINT "tb_faster_auto_user_pkey" PRIMARY KEY ("id"),
  CONSTRAINT "tb_faster_auto_user_class_fkey" FOREIGN KEY ("class") REFERENCES "public"."tb_faster_auto_class" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
);

🛠️ 高级配置

Faster({
  modelDir: './models',
  db: {
    dialect: 'mysql',
    host: 'localhost',
    username: 'root',
    password: '123456',
    database: 'test'
  },
  swagger: true,              // 启用 swagger
  redoc: true,                // 启用 redoc
  logStartupInfo: true,       // 启动时打印 API 地址
  apiPrefix:'/api'
});

📚 API 文档


📤 自动生成的接口

假设有一个模型 user,将自动生成以下接口:

| 方法 | 路径 | 描述 | | ------ | ----------- | ------------ | | GET | /user | 获取列表 | | GET | /user/:id | 获取单条记录 | | POST | /user | 创建记录 | | PUT | /user/:id | 更新记录 | | DELETE | /user/:id | 删除记录 |


💡 TODO 计划

  • [x] 支持自定义API
  • [x] 模型字段中文文档描述提取
  • [ ] 支持 GraphQL 自动生成
  • [ ] 自动生成 Markdown 接口文档
  • [ ] 支持模型字段级权限控制

🧠 谁适合使用?

  • 希望快速构建内部/后台接口的开发者
  • 用 Sequelize 写了很多重复接口逻辑的人
  • 想快速做一个低代码 API 服务骨架

🧑‍💻 作者

@yao xiao
开源、自由、极简主义者


🪪 License

MIT