currency-fa
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

currency-fa

A simple utility library that maps ISO 4217 currency codes to their corresponding Font Awesome currency icon names.

Description

This library provides an easy way to get the appropriate Font Awesome icon name for any standard ISO 4217 currency code. It's useful for applications that need to display currency symbols using Font Awesome icons.

Installation

Using pnpm (recommended):

pnpm add currency-fa

Using npm:

npm install currency-fa

Using yarn:

yarn add currency-fa

Usage

import { getCurrencyFaName, getCurrencyFaFullName } from "currency-fa";

// Get base Font Awesome name
const usdIcon = getCurrencyFaName("USD"); // Returns 'dollar'

// Get complete Font Awesome class name
const eurIcon = getCurrencyFaFullName("EUR"); // Returns 'fa-euro-sign'
const gbpIcon = getCurrencyFaFullName("GBP"); // Returns 'fa-pound-sign'

// Handling unsupported currencies
const unknownIcon = getCurrencyFaFullName("XYZ"); // Returns null

Supported Currencies

The library supports the following currencies:

  • USD (US Dollar) → fa-dollar-sign
  • EUR (Euro) → fa-euro-sign
  • GBP (British Pound) → fa-pound-sign
  • JPY (Japanese Yen) → fa-yen-sign
  • RUB (Russian Ruble) → fa-ruble-sign
  • INR (Indian Rupee) → fa-rupee-sign
  • ILS (Israeli Shekel) → fa-shekel-sign
  • CHF (Swiss Franc) → fa-franc-sign
  • KRW (South Korean Won) → fa-won-sign
  • BTC (Bitcoin) → fa-bitcoin-sign
  • LTC (Litecoin) → fa-litecoin-sign
  • THB (Thai Baht) → fa-baht-sign
  • BRL (Brazilian Real) → fa-brazilian-real-sign

Additionally, these currencies use the dollar sign:

  • HKD (Hong Kong Dollar)
  • AUD (Australian Dollar)
  • CAD (Canadian Dollar)

Requirements

  • Font Awesome 5 or newer must be installed in your project for the icons to display properly

Contributing

Contributions are welcome! Please read our Contributing Guidelines before submitting a Pull Request.

License

MIT License

Issues

If you find a bug or want to request a new feature, please open an issue on the GitHub repository.

Author

Ofek Gabay (ofek.gabay.he@gmail.com)

Package Sidebar

Install

npm i currency-fa

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

8.34 kB

Total Files

14

Last publish

Collaborators

  • tupe12334