@air/api-core

中文文档
0.12.0发布于 2026/11/06MITTypeScriptESM + CJS零依赖近 30 天下载 2.3万

Core HTTP engine for Air API SDK

原始使用文档
文档目录4 节
  1. Installation
  2. What's included
  3. Documentation
  4. License

@air/api-core

Core HTTP engine for the Air API SDK.

This package provides the low-level HTTP client, pagination, error classes, and retry logic used by @air/api-rest and @air/api-sdk.

Installation

Most users should install @air/api-sdk instead, which includes this package:

npm install @air/api-sdk

If you only need the core HTTP primitives:

npm install @air/api-core

What's included

  • AirClient — HTTP client with automatic retries, timeouts, and header management
  • PagePromise / CursorPage — async-iterable pagination
  • Error classes — APIError, BadRequestError, AuthenticationError, NotFoundError, RateLimitError, ConnectionError, TimeoutError, etc.
  • Retry logic with exponential backoff for transient failures

Documentation

License

MIT

版本与发布记录

@air/api-core 共发布 14 个版本,首次发布于 2026/03/28;过去 12 个月发布了 14 个版本。

版本发布日期距今
0.12.0latest2026/11/061 天前
0.11.02026/10/309 天前
0.10.02026/10/299 天前
0.9.02026/10/2811 天前
0.8.02026/10/2711 天前
0.7.02026/10/2217 天前

关于 @air/api-core 的常见问题

@air/api-core 是什么?

Core HTTP engine for Air API SDK

如何安装 @air/api-core?

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

@air/api-core 支持 TypeScript 吗?

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

@air/api-core 支持 ESM 还是 CommonJS?

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

@air/api-core 需要什么版本的 Node.js?

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

@air/api-core 可以商用吗?

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

@air/api-core 的下载量有多少?

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

@air/api-core 还在维护吗?

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