@freqhole/api-client

中文文档
0.3.27发布于 2026/11/10ES Module构建来源已验证近 30 天下载 2663

type-safe TypeScript client for freqhole APIs.

原始使用文档
文档目录4 节
  1. install
  2. quick start
  3. package structure
  4. development notes

@freqhole/api-client

type-safe TypeScript client for freqhole APIs.

this package wraps generated route + schema metadata with a small runtime client so requests are validated and typed on both input and output.

install

npm i @freqhole/api-client

for local monorepo usage, this repo usually links it by file path.

quick start

import { createHttpClient } from "@freqhole/api-client";

const api = createHttpClient({
  baseUrl: "http://localhost:4315",
});

const songs = await api.music.listSongs({
  query: { limit: 25, offset: 0 },
});

if (songs.success) {
  console.log(songs.data.songs.length);
}

package structure

  • src/codegen/schema.ts: generated zod schemas
  • src/codegen/routes.ts: generated route metadata
  • src/*.ts: hand-written helpers and client adapters

avoid editing files under src/codegen/ directly.

development notes

if you are working in this repo and need to regenerate types/routes, run codegen from client-codegen/.

the full generator workflow and architecture docs live in client-codegen/README.md.


made with 💖 in NYC

版本与发布记录

@freqhole/api-client 共发布 45 个版本,首次发布于 2026/06/18;过去 12 个月发布了 45 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.27latest2026/11/105 天前
0.3.262026/11/078 天前
0.3.252026/11/0510 天前
0.3.242026/11/0510 天前
0.3.232026/11/0313 天前
0.3.222026/10/2818 天前

关于 @freqhole/api-client 的常见问题

@freqhole/api-client 是什么?

type-safe TypeScript client for freqhole APIs.

如何安装 @freqhole/api-client?

在项目目录运行 npm install @freqhole/api-client,或使用 pnpm add / yarn add / bun add。

@freqhole/api-client 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/freqhole__api-client 是否存在。

@freqhole/api-client 支持 ESM 还是 CommonJS?

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

@freqhole/api-client 可以商用吗?

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

@freqhole/api-client 的下载量有多少?

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

@freqhole/api-client 还在维护吗?

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