@edgeone/framework-detect

中文文档
0.2.0发布于 2025/12/29ISCTypeScriptESM + CJS近 30 天下载 1.6万

网络项目框架检测库

中文使用文档
文档目录10 节
  1. 安装
  2. 使用方法
  3. 本地检测
  4. 远程仓库检测
  5. API 密码
  6. describeFramework(projectRoot: string): Promise<FrameworkIn…
  7. describeFrameworkRemote(body: GitProviderBody, auth?: any):…
  8. 支持的框架
  9. {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF…
  10. 开发

框架检测

。

安装

tnpm install @tencent/framework-detect

使用方法

本地检测

import { describeFramework } from '@tencent/framework-detect';

// 检测项目框架
const frameworkInfo = await describeFramework('./my-project');
console.log(frameworkInfo);

远程仓库检测

· GitHub、Gitee、GitLab、Bitbucket 四大平台的远程仓库检测。

GitHub 图像

import { describeFrameworkRemote } from '@tencent/framework-detect';

// 公开仓库(无认证,有速率限制)
const result = await describeFrameworkRemote({
  Provider: "Github",
  Namespace: "vercel",
  RepoName: "next.js",
  RootDir: "examples/blog",
});

// 私有仓库(需要 Token)
const result = await describeFrameworkRemote({
  Provider: "Github",
  Namespace: "your-org",
  RepoName: "your-repo",
}, {
  Token: "ghp_xxxxx", // GitHub Personal Access Token
});

齿轮

const result = await describeFrameworkRemote({
  Provider: "Gitee",
  Namespace: "oschina",
  RepoName: "gitee",
}, {
  Token: "your_gitee_token",
});

吉特拉布语Name

// 支持 gitlab.com 和自建实例
const result = await describeFrameworkRemote({
  Provider: "Gitlab",
  Namespace: "gitlab-org",
  RepoName: "gitlab",
  Branch: "master",
}, {
  Token: "glpat-xxxxx",
  BaseUrl: "https://gitlab.com", // 自建实例请修改此 URL
});

键盘

// Bitbucket Cloud
const result = await describeFrameworkRemote({
  Provider: "Bitbucket",
  Namespace: "atlassian",
  RepoName: "stash-example-plugin",
  Branch: "master",
}, {
  Token: "your_app_password", // App Password 或 OAuth Token
});

// Bitbucket Data Center(自建)
const result = await describeFrameworkRemote({
  Provider: "Bitbucket",
  Namespace: "PROJECT_KEY",
  RepoName: "repo-slug",
}, {
  Token: "your_personal_access_token",
  BaseUrl: "https://bitbucket.example.com",
});

零点点数 (原始内容存档于2013-10-12). Bitbucket Guide.md

API 密码

describeFramework(projectRoot: string): Promise<FrameworkInfo>

{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得怎么样。

参数:

  • projectRoot (字符串): 项目根目录路径

返回值:

  • Promise<FrameworkInfo>时间轴:

describeFrameworkRemote(body: GitProviderBody, auth?: any): Promise<FrameworkInfo>

」。

参数:

  • body (吉特普罗维德·博迪):
    • Provider数字 : "Github" | "Gitee" | "Gitlab" | "Bitbucket"
    • Namespace: 用户名/组织名/工作空间ID/项目密钥
    • RepoName时间轴:
    • RootDir?页:1
    • Branch?页:1
  • auth? (任何):
    • GitHub : (中文(简体) ) { Token: "ghp_xxxxx" } / 八角星 ***
    • 枪: { Token: "your_token" }
    • GitLab: (英语) { Token: "glpat-xxxxx", BaseUrl?: "https://gitlab.com" }
    • 键盘 : { Token: "your_token", BaseUrl?: "https://api.bitbucket.org" }

返回值:

  • Promise<FrameworkInfo>时间轴:

返回对象结构:

interface FrameworkInfo {
  Framework: string;    // 框架名称
  BuildCmd: string;     // 构建命令
  InstallCmd: string;   // 安装命令
  OutputDir: string;    // 输出目录
  IconPath?: string;    // 图标路径(可选)
}

支持的框架

  • 下一个.js
  • 盖茨比
  • 重混合
  • 反应路由器
  • 天体
  • 十六岁
  • 十一号
  • 多龙
  • 固态
  • 阴道
  • 角质
  • 丝绒
  • 反应
  • 坚果
  • 齐克
  • 浩诺
  • 维特

{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得呢

+++++++++++++++公开仓库私有仓库自建实例认证方式
GitHub 图像✅✅✅个人访问托肯
齿轮✅✅❌个人访问托肯
吉特拉布语Name✅✅✅个人访问托肯
键盘✅✅✅OAuth 2.0 / App 密码/ PAT

开发

# 安装依赖
npm install

# 构建
npm run build

# 运行测试
npm run test

# 测试远程检测
bun testRemote.ts

版本与发布记录

@edgeone/framework-detect 共发布 4 个版本,首次发布于 2025/09/04;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.2.0latest2025/12/2910 个月前
0.1.02025/10/271 年前
0.0.22025/09/171.2 年前
0.0.12025/09/041.2 年前

关于 @edgeone/framework-detect 的常见问题

@edgeone/framework-detect 是什么?

网络项目框架检测库

如何安装 @edgeone/framework-detect?

在项目目录运行 npm install @edgeone/framework-detect,或使用 pnpm add / yarn add / bun add。

@edgeone/framework-detect 支持 TypeScript 吗?

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

@edgeone/framework-detect 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@edgeone/framework-detect 可以商用吗?

@edgeone/framework-detect 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@edgeone/framework-detect 的下载量有多少?

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

@edgeone/framework-detect 还在维护吗?

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