空运协会的数据
轻量级ES模块将IATA机场代码的舟形图暴露出纬度/经度坐标. 用于快速取景、验证和地理工具.
安装
bun add @adaptivelink/iata
# or
npm i @adaptivelink/iata
# or
yarn add @adaptivelink/iata
# or
bun i @adaptivelink/iata
快速启动
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
数据集导出为可执行 Map,使其易于过滤、转换或序列化集合。 坐标以十进制度存储.
项目结构
src/编写源(数据集和模块切入点)dist/生成 Bun建设下游项目消耗的产出main.d.tsTypeScript 声明与src/test/Bun 测试套件,涵盖公共 API 和数据集完整性
发展
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/
格式由全球安装处理 oxfmt在运行构建前安装它 :
oxfmt --version
测试套房从 src/ 因此它可以验证当前源的更改而不需要首先重建.
更新机场数据
添加或修改条目 src/airports.js,保留大写三字母代码和有效纬度/经度范围。 更新 main.d.ts 如果您引入了新类型或元数据。 在打开拉出请求前运行构建并测试命令.
捐款
见 AGENTS.md (c) 制定捐助方准则、承诺订立公约和审查预期.
许可证
麻省理工学院