@adaptivelink/iata

中文文档
0.1.6发布于 2026/03/20MITTypeScriptES Module零依赖近 30 天下载 1893

IATA codes

原始使用文档
文档目录7 节
  1. Installation
  2. Quick Start
  3. Project Structure
  4. Development
  5. Updating Airport Data
  6. Contributing
  7. License

IATA data

npm

A lightweight ES module that exposes a canonical map of IATA airport codes to latitude/longitude coordinates. Built for quick lookups, validation, and geographic tooling.

Installation

bun add @adaptivelink/iata
# or
npm i @adaptivelink/iata
# or
yarn add @adaptivelink/iata
# or
bun i @adaptivelink/iata

Quick Start

import iata from "@adaptivelink/iata";

const airports = iata.airports; // Map<string, [latitude, longitude]>

console.log(airports.get("CDG")); // => [49.009724, 2.547778]
console.log(airports.size); // total airports in the dataset

The dataset is exported as an iterable Map, making it easy to filter, transform, or serialize the collection. Coordinates are stored in decimal degrees.

Project Structure

  • src/ authoring source (dataset and module entry point)
  • dist/ generated Bun build output consumed by downstream projects
  • main.d.ts TypeScript declarations kept in sync with src/
  • test/ Bun test suite covering the public API and dataset integrity

Development

bun install           # install dependencies
bun run build         # run global oxfmt, then build dist/bundle.js with Bun
bun test              # run the Bun test suite in test/

Formatting is handled by a globally installed oxfmt. Install it before running the build:

oxfmt --version

The test suite reads from src/ so it validates current source changes without requiring a rebuild first.

Updating Airport Data

Add or amend entries in src/airports.js, preserving uppercase three-letter codes and valid latitude/longitude ranges. Update main.d.ts if you introduce new types or metadata. Run the build and test commands before opening a pull request.

Contributing

See AGENTS.md for contributor guidelines, commit conventions, and review expectations.

License

MIT © Hugo Romano

版本与发布记录

@adaptivelink/iata 共发布 21 个版本,首次发布于 2020/09/17;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.1.6latest2026/03/207 个月前
0.1.42022/09/264 年前
0.1.32022/09/254 年前
0.1.22022/08/184 年前
0.1.12022/08/184 年前
0.1.02022/05/134 年前

关于 @adaptivelink/iata 的常见问题

@adaptivelink/iata 是什么?

IATA codes

如何安装 @adaptivelink/iata?

在项目目录运行 npm install @adaptivelink/iata,或使用 pnpm add / yarn add / bun add。

@adaptivelink/iata 支持 TypeScript 吗?

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

@adaptivelink/iata 支持 ESM 还是 CommonJS?

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

@adaptivelink/iata 可以商用吗?

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

@adaptivelink/iata 的下载量有多少?

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

@adaptivelink/iata 还在维护吗?

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