@ankhorage/project-detector

中文文档
0.3.5发布于 2026/10/11MITTypeScriptES Module构建来源已验证近 30 天下载 21万

Extensible, evidence-based project detection and safe filesystem inspection for standalone tools.

原始使用文档
文档目录3 节
  1. Generated documentation
  2. Public API
  3. Utilities

@ankhorage/project-detector

license: MIT npm: v0.3.2 runtime: bun typescript: strict eslint: checked prettier: checked build: checked tests: checked docs: paradox

Extensible, evidence-based project detection and safe filesystem inspection.

Generated documentation

Public API

Utilities

detectProject
detectProject(input: ProjectDetectionInput, options?: ProjectDetectionOptions) => ProjectDetection

Detect overlapping project languages, frameworks, runtimes and package-manager evidence.

The pure API accepts package metadata plus optional relative POSIX file paths and manifest text. JavaScript, TypeScript, Java, Kotlin, C++, Python and Delphi evidence is additive, never exclusive. Generic Make/CMake/Gradle files identify build tools, not necessarily a source language. Scores are heuristic strengths, not confidence probabilities. No source parser, registry request, dependency update, migration, filesystem operation or inspected project script runs here. Extend detection with explicitly supplied trusted detector callbacks; IDs must be unique. Public types are owned by this package and exported through @ankhorage/project-detector/types.

Module: src/features/detection/application/detectProject.ts Source: src/features/detection/application/detectProject.ts:24:1 Related symbols: ProjectDetection, ProjectDetectionInput, ProjectDetectionOptions

inspectProjectAsync
inspectProjectAsync(path: string, options?: ProjectInspectionOptions) => Promise<ProjectInspection>

Inspect a directory using bounded, asynchronous, read-only filesystem access.

Import from @ankhorage/project-detector/node. Defaults: depth 16, 20,000 entries, 256 KiB per manifest and 8 MiB total manifest text. Dependency/build/cache directories, including generated .ankh, are pruned. Symlinks outside exclusions are skipped with path-bearing warnings; they do not alone make a scan incomplete. Their targets are never intentionally scanned. Pass an AbortSignal to cancel. Configure additional manifest basenames and detector callbacks for new ecosystems. Package/workspace membership currently resolves JavaScript package.json workspaces and pnpm YAML; other ecosystem manifests are identified, not fully resolved into dependency graphs. No inspected JavaScript, Gradle, Python, executable config or install script is executed. Inspection is a best-effort snapshot, not a sandbox against concurrent hostile filesystem edits. Returned directories and files are sorted relative POSIX paths from the pruned scan. The directory inventory includes empty directories and omits the inspection root itself. The result reports incompleteness; it never grants permission to run an update. On a complete scan output is sorted; when a budget is exhausted the retained subset depends on filesystem enumeration order. Inspect a stable checkout for reproducible results. Install with npm install @ankhorage/project-detector; the standalone command is npx --package @ankhorage/project-detector project-detector inspect .. With Ankh installed, use ankh project-detector inspect .. CLI exit codes are 0 for a complete scan, 1 for invocation/root errors and 2 for partial scans. Release automation requires the organization release App configuration and npm publishing authorization for this new package; repository files alone do not provision these credentials.

Module: src/features/inspection/composition/inspectProjectAsync.ts Source: src/features/inspection/composition/inspectProjectAsync.ts:31:1 Related symbols: ProjectInspection, ProjectInspectionOptions

版本与发布记录

@ankhorage/project-detector 共发布 10 个版本,首次发布于 2026/09/14;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.5latest2026/10/1126 天前
0.3.42026/10/0729 天前
0.3.32026/09/281 个月前
0.3.22026/09/281 个月前
0.3.12026/09/221 个月前
0.3.02026/09/221 个月前

关于 @ankhorage/project-detector 的常见问题

@ankhorage/project-detector 是什么?

Extensible, evidence-based project detection and safe filesystem inspection for standalone tools.

如何安装 @ankhorage/project-detector?

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

@ankhorage/project-detector 支持 TypeScript 吗?

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

@ankhorage/project-detector 支持 ESM 还是 CommonJS?

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

@ankhorage/project-detector 需要什么版本的 Node.js?

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

@ankhorage/project-detector 可以商用吗?

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

@ankhorage/project-detector 的下载量有多少?

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

@ankhorage/project-detector 还在维护吗?

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