@band-app/server

中文文档
0.64.0发布于 2026/11/07TypeScriptES Module近 30 天下载 5699

Web server + dashboard frontend for Band. Provides the tRPC API, WebSocket layer, and bundled UI consumed by the Electron desktop app and (optionally) standalone npm consumers.

原始使用文档
文档目录5 节
  1. Runtime: Node.js 22.5+
  2. SQLite via node:sqlite
  3. Install
  4. Development
  5. Bundle layout ( dist/ )

@band-app/server

Web server + dashboard frontend for Band. Provides the tRPC API, WebSocket layer, and bundled UI consumed by the Electron desktop app and (optionally) standalone npm consumers.

Runtime: Node.js 22.5+

This package runs under Node.js v22.5 or newer. CI tests it on Node 24 (.nvmrc at the repo root), the version the desktop app bundles. The shebang on bin/band-server.mjs is #!/usr/bin/env node.

ℹ️ Users running the Band desktop app do not need to install Node themselves — the desktop shell ships its own bundled Node runtime (via Electron) and spawns the web server under it. The Node 22.5+ requirement only applies to people running this package directly via band-server / node dist/start-server.mjs, or doing local development against the source tree.

# Run the server (standalone consumer scenario)
band-server
# or:
node dist/start-server.mjs

SQLite via node:sqlite

SQLite is provided by Node's built-in node:sqlite module — no native module ships in the bundle. This eliminates the NODE_MODULE_VERSION ABI mismatch that affects packages like better-sqlite3: whatever Node the user runs supplies node:sqlite directly, so the binary always matches the runtime.

node:sqlite is at Stability 1.2 — Release Candidate in current Node, available unflagged since 22.13.0. The API has been stable across Node 22.5 → 23.x → 24.x. The startup ExperimentalWarning can be silenced with NODE_OPTIONS='--no-warnings=ExperimentalWarning' (the test and e2e scripts in package.json already do this).

We were briefly on bun:sqlite (PR #353) to dodge the same ABI problem, but Bun's node:http shim doesn't fire upgrade events on httpServer.on("upgrade", …), breaking tRPC subscription, terminal, and LSP WebSockets (oven-sh/bun#18945, #5951, #24107). node:sqlite gets us the same ABI-stability win without changing the JS runtime.

Install

For the standalone scenario (running band-server outside the desktop app), Node v22.5+ must be on PATH. Desktop app users can skip this section — the .app brings its own Node.

# 1. Install Node.js 22.5+ (https://nodejs.org)

# 2. Install the package
npm i -g @band-app/server       # or: pnpm add -g

# 3. Run
band-server                   # starts on PORT (default 3456)

Environment:

VarDefaultNotes
PORT3456TCP port to bind
HOME/.band—State directory (sqlite db, settings, logs)

Development

pnpm install          # at repo root
pnpm dev              # hub with Vite serving apps/web in-process (HMR, one port)
pnpm build            # UI (apps/web/dist/client), then the hub bundle (apps/hub/dist)
pnpm --filter @band-app/server test       # backend integration tests (vitest under Node)
pnpm --filter @band-app/web test:e2e   # Playwright, booting the hub bundle

The vitest suite, the production bundle (dist/start-server.mjs), and the Playwright e2e helper all run under Node.

Bundle layout (dist/)

dist/
├── start-server.mjs           # esbuild bundle, entry point
├── client/                    # built dashboard frontend (vite)
├── server/                    # SSR server bundle
├── migrations/                # drizzle SQL migrations
├── openapi.json               # generated tRPC OpenAPI spec
└── node_modules/              # only externalized native deps + helpers
    ├── node-pty/              # native PTY (.node + spawn-helper, NAPI — ABI-stable)
    └── @openai/codex/         # Codex SDK package.json (codex CLI is system-installed)

No SQLite native module ships in the bundle.

版本与发布记录

@band-app/server 共发布 99 个版本,首次发布于 2026/05/05;过去 12 个月发布了 99 个版本。

版本发布日期距今
0.64.0latest2026/11/07今天
0.63.02026/11/07今天
0.62.02026/11/071 天前
0.61.02026/11/061 天前
0.60.12026/11/062 天前
0.60.02026/11/052 天前

关于 @band-app/server 的常见问题

@band-app/server 是什么?

Web server + dashboard frontend for Band. Provides the tRPC API, WebSocket layer, and bundled UI consumed by the Electron desktop app and (optionally) standalone npm consumers.

如何安装 @band-app/server?

在项目目录运行 npm install @band-app/server,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 band-server,可以用 npx band-server 直接运行。

@band-app/server 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@band-app/server 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@band-app/server 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.5.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@band-app/server 可以商用吗?

@band-app/server 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@band-app/server 的下载量有多少?

根据 npm 官方下载统计,@band-app/server 在 2026/10/08 – 2026/11/06 这 30 天内被下载 5,699 次,日均约 190 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@band-app/server 还在维护吗?

最新版本 0.64.0 发布于 2026/11/07(今天);至今共发布 99 个版本,其中过去 12 个月发布了 99 个;首次发布于 2026/05/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。