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

bootgs

v1.10.1

Published

Boot Framework for Google Apps Script™ projects.

Readme

Project banner for Google Apps Script Boot Framework

English | Українська | Русский | Deutsch | Français | Español | Português | 日本語 | 中文

本译文在 AI 辅助下根据 1.10.0 版本的 README.md 翻译而成,内容以英文版 README 为准。欢迎提出修改建议,详见 CONTRIBUTING.md。

Boot Framework for Google Apps Script™

简介

Boot.gs 是一个轻量级框架,用于构建结构清晰的 Google Apps Script 应用。它把装饰器、依赖注入等常见的开发模式引入 Apps Script 环境,让代码更易于组织。

控制器与运行环境无关:同一套代码既能处理 doGet/doPost Web 请求,也能处理来自侧边栏和对话框的 google.script.run 调用,以及 onOpen、onEdit 等 Google Workspace 事件。

功能特性

  • 基于装饰器的路由:直观地映射 HTTP 请求和 Apps Script 事件(GET、POST 等)。
  • Spring Boot 与 NestJS 模式:熟悉的 @RequestMapping、@RestController、@ResponseBody 等装饰器以及 ResponseEntity 类。
  • 灵活的响应:通过 ResponseEntity 完全控制 HTTP 状态码、响应头和 MIME 类型。
  • 参数校验:使用 @Min、@Max、@Email 等 Spring Boot 风格的装饰器进行声明式参数校验。
  • Pipes 与校验:通过 @UsePipes 和内置 pipes(如 ParseNumberPipe)转换并校验输入数据。
  • 全局错误处理:使用 @ControllerAdvice 和 @ExceptionHandler 集中管理异常。
  • 依赖注入:功能完整的 DI,降低耦合、便于测试。
  • 类型安全:基于 TypeScript 构建,开发体验更可靠。
  • 现代架构:借鉴 NestJS 和 Spring Boot 等框架的设计。

环境要求

  • 使用 V8 运行时的 Google Apps Script 项目,通常通过 clasp 在本地管理。
  • 在 tsconfig.json 中启用 experimentalDecorators 和 emitDecoratorMetadata 的 TypeScript。
  • 用于安装和构建的 Node.js >=22.14.0 及 npm。

安装

通过 npm 安装框架:

npm install bootgs

快速上手

1. 定义控制器

创建一个承载应用逻辑的类。装饰器负责把方法映射到具体的端点或事件。

import {Get, RestController} from "bootgs";

@RestController("api/sheet")
export class SheetController {
    /**
     * Handles GET requests to /api/sheet/active-range
     */
    @Get("active-range")
    getActiveRange(): string {
        return "This action returns the active sheet range.";
    }
}

2. 初始化应用

创建 App 实例,并把 Apps Script 的标准入口函数委托给它,框架就能拦截并路由传入的事件。

import {App} from "bootgs";
import {SheetController} from "./SheetController";

/**
 * Global entry point for GET requests.
 */
export function doGet(event: GoogleAppsScript.Events.DoGet) {
    const app = App.create({
        controllers: [SheetController]
    });
    return app.doGet(event);
}

包含 doPost 和异步 AsyncApp 的完整步骤,请参阅 Quick Start 指南(英文)。

文档

详细指南目前提供英文版:

AI 智能体技能

正在使用 AI 编程智能体(Claude Code、Gemini CLI、Cursor 等)?bootgs/skills 仓库提供了一组 Agent Skills,教会智能体如何搭建、组织和校验 Boot.gs 应用,另外还有适用于一般 Google Apps Script 开发、与框架无关的技能。

/plugin marketplace add bootgs/skills
/plugin install bootgs@bootgs-skills

完整列表以及 Gemini CLI 和 npx skills 的安装方式,请参阅 AI Agent Skills。

推荐

[!TIP] 为了更顺畅地进行 Google Apps Script 开发,推荐使用 @bootgs/utils,它是一组与本框架相辅相成的工具函数和类。

贡献者

参与贡献

欢迎贡献!行为准则和提交 pull request 的流程请参阅 贡献指南。如需报告安全漏洞,请遵循 安全策略。

路线图

查看 路线图,了解后续版本的计划。

更新日志

详细的变更与更新列表请参阅 CHANGELOG。

支持

问题和错误报告请提交到 GitHub Issues。如果这个项目对你有帮助,欢迎通过 GitHub Sponsors 或 Buy Me a Coffee 支持它。

许可证

本项目基于 Apache-2.0 许可证 发布。