# @aerapass/country-data 中文文档

规范地址：https://npmcn.com/package/%40aerapass/country-data/

版本：1\.1\.1
npm 元数据更新时间：2026-01-26T11:39:54.837Z
中文译文更新时间：2026-11-06T20:50:00.014Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40aerapass/country-data
原文对照：https://npmcn.com/package/%40aerapass/country-data/?lang=original
项目主页：https://github.com/aerapass/country-data#readme
源码仓库：https://github.com/aerapass/country-data

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：303 kB，42 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- 运行依赖：2 个
- 首次发布：2020-07-09T08:56:14.880Z
- 最新版本发布：2026-01-26T11:39:54.369Z
- 近 30 天下载量：2359（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：6（近 12 个月 1 个）

## 中文简介

国家数据----如其ISO代码和货币

## 安装

```sh
npm install @aerapass/country-data
```

也可以使用：`pnpm add @aerapass/country-data`、`yarn add @aerapass/country-data`、`bun add @aerapass/country-data`

## README

# 国家数据

[![npm](https://img.shields.io/npm/v/@aerapass/country-data.svg)](https://www.npmjs.com/package/@aerapass/country-data) ![Main CI](https://github.com/aerapass/country-data/workflows/Main%20CI/badge.svg) [![codecov](https://codecov.io/gh/aerapass/country-data/branch/master/graph/badge.svg)](https://codecov.io/gh/aerapass/country-data) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) ![GitHub](https://img.shields.io/github/license/aerapass/country-data)

关于国家的数据 -- -- 如其ISO代码和货币 -- -- 有打字.

## 安装

```
npm install @aerapass/country-data
```

## 使用量

```typescript
import { countries, continents, currencies, regions } from '@aerapass/country-data'

// .all gives you an array of all entries
console.log(countries.all)
console.log(currencies.all)

// countries are found using alpha2 or alpha3 (both uppercase)
console.log(countries.BE.name) // 'Belgium'
console.log(countries.FRA.currencies) // ['EUR']

// currencies are accessed by their code (uppercase)
console.log(currencies.USD.name) // 'United States Dollar'

// regions are accessed using a camel case name
console.log(regions.europe.countries)
```

## 国家

目前为每个国家提供的数据是:

-   `name` 国家的英文名
-   `alpha2` 这个 [ISO 3166-1 α 2 标准](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) 代码
-   `alpha3` 这个 [ISO 3166-1 α 3 标准](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) 代码
-   `status`: 该条目的ISO状态 - 见下文.
-   `currencies` 数组 [ISO 4217 货币编码](http://en.wikipedia.org/wiki/ISO_4217) 和初等一样
-   `languages` 数组 [ISO 639-2 标准](http://en.wikipedia.org/wiki/ISO_639-2) 语言代码( 可能不完全) .
-   `countryCallingCodes` 这个国家的一系列国际呼叫前缀.
-   `ioc` 这个 [国际奥林匹克委员会国家代码](http://en.wikipedia.org/wiki/List_of_IOC_country_codes)
-   `emoji` 国旗的爱莫吉.
-   `numeric` 这个 [ISO 3166-1 数字](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) 代码

### 情况说明

这个 `status` 可以是“ 指定”、“ 保留”、“ 用户指定” 或“ 删除” 之一.

指定指该代码在ISO 3166标准中正确. 被保留意味着该代码被阻止被使用. 删除意味着它已被删除。 用户指定是指某些用途需要使用。 删除意味着它曾经是标准,但现在不是.

见 [https://en.wikipedia.org/wiki/ISO 3166-1 alpha-2 互联网档案馆的存檔,存档日期2014-12-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) ,特别是“用户指定代码元素”和“保留代码元素”部分.

## 区域

各国按区域分类。 区域清单绝非详尽无遗,非常欢迎关于增列的请求.

-   `countries` 数组 `alpha2` 本区域各国的守则.

## 货币

仅仅有一国的货币编码并不那么有用,所以包括货币数据:

-   `name` 货币的英文名称
-   `code` 这个 [国际标准化组织 4217](http://en.wikipedia.org/wiki/ISO_4217) 代码
-   `number` 这个 [国际标准化组织 4217](http://en.wikipedia.org/wiki/ISO_4217) 编号
-   `decimals` 常规显示的小数位数
-   `symbol` 货币的货币符号(例如:美元等)。 有些符号不可用,在这种情况下 `symbol` 包含 ISO 4217 代码。 贷记至 [bengourley/货币符号图](https://github.com/bengourley/currency-symbol-map) 用于符号数据库.

## 来源

货币数据是从 [维基百科 ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) 页 次.

国家呼叫代码来自 [维基百科国家呼叫代码](http://en.wikipedia.org/wiki/List_of_country_calling_codes) 页 次.

## 常见问题

### @aerapass/country-data 是什么？

国家数据----如其ISO代码和货币

### 如何安装 @aerapass/country-data？

在项目目录运行 npm install @aerapass/country-data，或使用 pnpm add / yarn add / bun add。

### @aerapass/country-data 支持 TypeScript 吗？

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

### @aerapass/country-data 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @aerapass/country-data 可以商用吗？

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

### @aerapass/country-data 的下载量有多少？

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

### @aerapass/country-data 还在维护吗？

最新版本 1\.1\.1 发布于 2026/01/26（9 个月前）；至今共发布 6 个版本，其中过去 12 个月发布了 1 个；首次发布于 2020/07/09。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

