# @novastera-oss/currencies-info 中文文档

规范地址：https://npmcn.com/package/%40novastera-oss/currencies-info/

版本：1\.0\.3
npm 元数据更新时间：2026-11-02T00:12:11.143Z
中文译文更新时间：2026-11-02T01:07:42.660Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：50 kB，10 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：0 个
- 首次发布：2025-01-03T13:45:29.651Z
- 最新版本发布：2026-11-02T00:12:10.794Z
- 已发布版本数：3（近 12 个月 1 个）

## 中文简介

提供最新货币数据的综合图书馆，包括符号、ISO代码和国家协会。理想的开发人员需要准确和可定制的货币信息的全球应用程序。由Novastera提供动力。

## 安装

```sh
npm install @novastera-oss/currencies-info
```

也可以使用：`pnpm add @novastera-oss/currencies-info`、`yarn add @novastera-oss/currencies-info`、`bun add @novastera-oss/currencies-info`

## README

# Novastera：货币信息

一个全面的货币数据库，为全球商业应用程序提供准确的货币信息。包括最新的货币代码，符号，小数位数和国家协会。

## 功能

-   **完整的货币覆盖**
    
    -   所有ISO 4217货币代码
    -   加密货币支持（BTC， ETH等）
    -   每种货币的精确小数点
    -   官方货币符号
    -   Country-to-currency映射
-   **业务准备**
    
    -   完美的发票系统
    -   理想的ERP和CRM实施
    -   金融应用程序的多币种支持
    -   精确的十进制处理计算

## 安装

```bash
npm install @novastera-oss/currencies-info
# or
yarn add @novastera-oss/currencies-info
```

## 使用

```typescript
import { CURRENCIES } from '@novastera-oss/currencies-info';

// Get all currencies
console.log(CURRENCIES.list);
// ["USD", "EUR", "GBP", ...]

// Get currency details
console.log(CURRENCIES.currency["USD"]);
// { s: "$", d: 2 }  // s: symbol, d: decimal places

// Get currency options (useful for dropdowns)
console.log(CURRENCIES.options);
// [{ id: "USD", l: "United States Dollar (USD)" }, ...]

// Get currencies used in a country
console.log(CURRENCIES.country["FR"]);
// ["EUR"]
```

## 类型

```typescript
interface CurrencyInfo {
  s: string;  // Currency symbol
  d: number;  // Number of decimal places
}

interface OptionType {
  id: string;  // Currency code
  l: string;   // Display label
}

interface Currencies {
  list: string[];                        // All available currency codes
  options: OptionType[];                 // Formatted options for dropdowns
  currency: Record<string, CurrencyInfo>;// Currency details by code
  country: Record<string, string[]>;     // Country to currency mappings
}
```

## 用例

-   需要精确货币格式的金融软件
-   国际电子商务平台
-   支持多币种的ERP系统
-   客户关系管理系统处理国际客户
-   要求货币精度的发票系统
-   金融计算器和转换器

## 关于

的一部分 [Novastera](https://novastera.com/)的业务管理解决方案套件，这个包确保准确的货币处理跨您所有的业务应用程序。访问我们的 [网站](https://novastera.com/) 了解更多关于我们的综合解决方案。

## 许可证

麻省理工学院© [Novastera](https://novastera.com/)

## 常见问题

### @novastera-oss/currencies-info 是什么？

提供最新货币数据的综合图书馆，包括符号、ISO代码和国家协会。理想的开发人员需要准确和可定制的货币信息的全球应用程序。由Novastera提供动力。

### 如何安装 @novastera-oss/currencies-info？

在项目目录运行 npm install @novastera-oss/currencies-info，或使用 pnpm add / yarn add / bun add。

### @novastera-oss/currencies-info 支持 TypeScript 吗？

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

### @novastera-oss/currencies-info 支持 ESM 还是 CommonJS？

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

### @novastera-oss/currencies-info 可以商用吗？

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

### @novastera-oss/currencies-info 还在维护吗？

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

