Skip to main content
@talosjs/currencies ships a curated dataset of world currencies (code, name, symbol, and flag icon) together with fully typed currency codes. It also includes a CurrencyConverter for managing exchange rates, converting amounts, and formatting them with the correct symbol.

Installation

Add the package with Bun.

Usage

Import the CURRENCIES dataset to look up metadata, or use CurrencyConverter to handle rates and conversions.

Browse the dataset

Convert between currencies

Create a converter with a base currency (rate 1) and seed it with rates expressed relative to that base.

Format and convert in one step

format prefixes the amount with the currency symbol; convertAndFormat converts then formats.

Two things it covers

The dataset side gives you a ready-made, typed list of currencies (codes, names, symbols, flag icons) to drive a dropdown, a picker, or validation. The converter side handles the arithmetic: feed it exchange rates you supply, perhaps fetched from a rates API, and it converts amounts and prefixes them with the right symbol without you reaching for Intl.NumberFormat configuration. If you only need locale-aware number formatting and no conversion, the native Intl.NumberFormat already covers that.