@mfaeezshabbir/world-currencies
v1.0.6
Published
A lightweight JSON dataset of world currencies with ISO codes, symbols, and country mappings.
Maintainers
Readme
🌍 @mfaeezshabbir/world-currencies
A lightweight and accurate dataset of world currencies, including country, currency name, symbol, and ISO 4217 code.
Perfect for global apps, fintech projects, and currency converters.
📦 Installation
Install from npm:
npm install @mfaeezshabbir/world-currenciesor with yarn:
yarn add @mfaeezshabbir/world-currencies🚀 Usage
You can import this package in TypeScript or JavaScript. The package is TypeScript-first and ships with .d.ts type declarations.
ESM / TypeScript:
import { getAllCurrencies, getCurrencyByCountry, getCurrencyByCode, getCurrencyBySymbol } from "@mfaeezshabbir/world-currencies";
console.log(getAllCurrencies());
console.log(getCurrencyByCountry("Pakistan"));
console.log(getCurrencyByCode("USD"));
console.log(getCurrencyBySymbol("$"));CommonJS:
const { getAllCurrencies } = require("@mfaeezshabbir/world-currencies");
console.log(getAllCurrencies());TypeScript
This package ships TypeScript declarations. You can import named exports in TypeScript or modern bundlers:
import { getAllCurrencies, getCurrencyByCode } from "@mfaeezshabbir/world-currencies";
const all = getAllCurrencies();The project also includes a tsconfig.json and a src/ entry so you can run npm run build to generate dist/ artifacts and .d.ts files.
📚 Data Format
Each record in the dataset follows this structure:
{
"country": "Japan",
"currency": "Japanese yen",
"symbol": "¥",
"code": "JPY"
}🧩 Methods
| Method | Description |
| ------------------------------- | ---------------------------------------------------- |
| getAllCurrencies() | Returns the full list of currencies |
| getCurrencyByCountry(country) | Finds a currency by country name (case-insensitive) |
| getCurrencyByCode(code) | Finds a currency by ISO 4217 code (case-insensitive) |
| getCurrencyBySymbol(symbol) | Finds a currency (list of array) by it's symbol |
🔧 Development
Clone and install dependencies:
If it does, remove that line. This package is published on npmjs.org, not GitHub Packages.
⚖️ License
Licensed under the MIT License.
👨💻 Author
Built with ❤️ by mfaeezshabbir
🌟 Contribute
Have suggestions or want to improve data accuracy? Open an issue or submit a pull request on GitHub.
