Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Tencent Server Web
| Date | Stars |
|---|---|
| 2026-07-24 | 1803 |
| 2026-07-25 | 1803 |
| 2026-07-28 | 1803 |
| 2026-07-30 | 1803 |
| 2026-08-06 | 1803 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
<h1 align="center"><a href="https://tswjs.org">Tencent Server Web 3.0</a></h1>
<p align="center">
<a href="https://github.com/Tencent/TSW/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg?style=for-the-badge" alt="license"></a>
<a href="https://github.com/Tencent/TSW/actions?query=workflow%3Abuild"><img src="https://img.shields.io/github/actions/workflow/status/tencent/tsw/lint-and-test-code.yml?style=for-the-badge" alt="Build Status"></a>
<a href="https://vitest.dev/"><img src="https://img.shields.io/badge/vitest-6E9F18?style=for-the-badge&logo=vitest&logoColor=white" alt="vitest"></a>
<a href="https://codecov.io/gh/tencent/tsw"><img src="https://img.shields.io/codecov/c/github/tencent/tsw?style=for-the-badge" alt="codecov"></a>
</p>
<h2 align="center">What is it</h2>
Tencent Server Web(TSW) 是一套面向 WEB 前端开发者,以提升问题定位效率为初衷,提供 **染色抓包** 和 **全息日志** 的 Node.js 基础设施。TSW 关注业务的运维监控能力,适用于 http、https 协议的业务场景,可无缝与现有应用(Koa、Express)进行整合。
TSW 2.0 在 1.0 的基础上抽丝剥茧,辅以现代化的设计模式,去除了 1.0 中的大量糟粕,同时对容器化、云原生更加友好。做到了无侵入、低成本接入。
TSW 3.0 在 2.0 的基础上全面拥抱现代化 Node.js 生态:
- **ESM 优先** — 包本身以 ESM 发布,同时完整支持 CJS 和 ESM 用户应用
- **Node.js >= 24** — 利用最新的 V8 引擎和 Node.js 特性
- 使用 AsyncLocalStorage 替代 Domain
<h2 align="center">Highlights</h2>
<table>
<tr>
<th><h4 align="center">🚀<h4 align="center">0 侵入</h4 align="center"></th>
<th><h4 align="center">📒</h4 align="center"><h4 align="center">全息日志</h4 align="center"></th>
<th><h4 align="center">🛠</h4 align="center"><h4 align="center">请求抓包</h4 align="center"></th>
</tr>
<tr>
<td width="33%">通过 Hack NodeJS 底层代码实现功能。对原有业务代码 0 侵入。</td>
<td width="33%">按照请求聚类的显微镜级别的全息日志,给开发者完美的现场还原。</td>
<td width="33%">可抓取 Server 端向外部发送的所有请求的完整包体内容,与后台沟通再无障碍。</td>
</tr>
</table>
<h2 align="center">从 2.0 迁移到 3.0</h2>
TSW 3.0 包含以下 **Breaking Changes**:
- **Node.js >= 24** — 不再支持 Node.js 24 以下版本
- **ESM 包** — `@tswjs/tsw` 现在以 ESM 格式发布(`"type": "module"`),但用户应用不受影响,CJS 和 ESM 均可正常加载
- **配置文件** — 推荐使用 `export default` 语法(`.mjs` 或在 `"type": "module"` 项目中使用 `.js`);传统的 `module.exports` 写法仍然兼容
- **moment 移除** — 如果你的插件依赖了 TSW 内部的 moment,需要自行替换
<h2 align="center">Quick Start</h2>
### 1. 安装
```bash
npm install --save @tswjs/tsw
# yarn add @tswjs/tsw
```
### 2. 添加配置文件
配置文件是 TSW 启动时加载进运行时的配置文件,主要声明需要使用的 [插件](#plugins) 列表。**默认会加载项目根目录下的 `tswconfig.js` 文件,也可以通过启动参数 `-c` 或者 `--config` 来手动指定配置文件路径。**
TSW 3.0 同时支持 CJS 和 ESM 配置文件:
**ESM 配置(推荐)** — 使用 `.mjs` 扩展名,或在 `"type": "module"` 的项目中使用 `.js`:
```js
// tswconfig.mjs
export default {
plugins: [
new MyPlugin({})
]
}
```
**CJS 配置** — 传统写法仍然兼容:
```js
// tswconfig.js
module.exports = {
plugins: [
new MyPlugin({})
]
}
```
**参数列表**:
| Name | Type | default | Optional | Description |
| :-: | :-: | :-: | :-: | :-: |
| plugins | Array<[Plugin](#plugins)>| - | yes | [插件](#plugins)列表 |
| cleanLog | boolean | `false` | yes | 是否关闭默认打印 |
| logLevel | `DEBUG/INFO/WARN/ERROR` | `DEBUG` | yes | 设置 log level |
| winstonTransports | Array<[TransportStream](https://github.com/winstonjs/winston-transport/blob/master/index.d.ts)> | - | yes | [Winston](#winston-是什么)日志通道 |
### 3. 启动
TSW CLI 支持加载 CJS(`.js`)和 ESM(`.mjs`)入口文件:
```bash
# CJS 入口
npx @tswjs/tsw ./index.js
# ESM 入口
npx @tswjs/tsw ./index.mjs
# 指定 ESM 配置文件
npx @tswjs/tsw -c tswconfig.mjs ./index.mjs
```
**注意事项**:原先 `node --inspect ./index.js` 中的 CLI 参数如 `--inspect` 需要转化为环境变量 `NODE_OPTIONS` 来执行,如 `NODE_OPTIONS="--inspect" npx @tswjs/tsw ./index.js`。
**使用 TypeScript**: 推荐使用 [tsx](https://www.npmjs.com/package/tsx),它无需额外配置即可支持 ESM + TypeScript:
```bash
NODE_OPTIONS="--import=tsx" npx @tswjs/tsw ./index.ts
```
也可以使用 [ts-node](https://www.npmjs.com/package/ts-node)(ESM 模式):
```bash
NODE_OPTIONS="--import=ts-node/esm" npx @tswjs/tsw ./index.ts
```
### CLI (Command Line Interface)
使用 `npx @tswjs/tsw --help` 来获取 CLI 选项。
### Examples
我们提供了一些示例项目以让大家尽快了解该项目。
1. `cd ~`
2. `git clone https://github.com/Tencent/TSW.git`
Excerpt of 9,194 characters
Read on GitHub292
220
Zhaofeng Miao · Tencent Inc. · China
197
152
66
66
25
18
14
8
8
7
5
5
4
3
2
2
2
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:1b5aa1425829a1c4, topic:observability