0.2.2 • Published 1 year ago
@desoukysvyc/currency v0.2.2
@desoukysvyc/currencies
A specialized sub-package for accessing currency-related information, including currency codes, details, and more.
Installation
You can install this package using npm:
npm install @desoukysvyc/currencies
Usage
Querying Currencies
The package provides a convenient query method for filtering currencies based on various criteria. Examples:
Find details about Currency By Code
import { currencies } from "@desoukysvyc/currencies";
const euroDetails = currencies.query({ code: "EUR" });
/* Output
[
{ code: 'EUR', decimal: 2, name: 'Euro', num: '978', symbol: '€' }
]
*/
Find currencies with a specific decimal value
import { currencies } from "@desoukysvyc/currencies";
const decimalCurrencies = currencies.query({ decimal: 2 });
/* Output
[
{
code: 'AED',
decimal: 2,
name: 'United Arab Emirates dirham',
num: '784',
symbol: 'د.إ'
},
{
code: 'AFN',
decimal: 2,
name: 'Afghan afghani',
num: '971',
symbol: '؋'
},
{
code: 'ALL',
decimal: 2,
name: 'Albanian lek',
num: '008',
symbol: 'L'
},
{
code: 'AMD',
decimal: 2,
name: 'Armenian dram',
num: '051',
symbol: '֏'
}
... 136 more items
]
*/
Find currencies with a specific symbol
import { currencies } from "@desoukysvyc/currencies";
const currencyWithSymbol = currencies.query({ symbol: "$" });
/* Output
[
{
code: 'ARS',
decimal: 2,
name: 'Argentine peso',
num: '032',
symbol: '$'
},
{
code: 'AUD',
decimal: 2,
name: 'Australian dollar',
num: '036',
symbol: '$'
},
{
code: 'BBD',
decimal: 2,
name: 'Barbados dollar',
num: '052',
symbol: '$'
},
{
code: 'BMD',
decimal: 2,
name: 'Bermudian dollar',
num: '060',
symbol: '$'
}
... 136 more items
]
*/
Typescript Support
Currency
type Currency = {
code: CurrencyCode;
decimal?: number;
name: string;
num: CurrencyNum;
symbol: string;
};
type CurrencyCode = "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BHD" | "GBP" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | ... 156 more ... | "XXX"
type CurrencyNum = "008" | "012" | "032" | "051" | "533" | "036" | "048" | "050" | "052" | "084" | "060" | "064" | "068" | "072" | "096" | "108" | "116" | "124" | "132" | "136" | "152" | "156" | "170" | ... 156 more ... | "932"
0.2.2
1 year ago
0.2.0
1 year ago
0.0.30
2 years ago
0.0.29
2 years ago
0.0.23
2 years ago
0.0.24
2 years ago
0.0.25
2 years ago
0.0.26
2 years ago
0.0.28
2 years ago
0.0.22
2 years ago
0.0.20
2 years ago
0.0.18
2 years ago
0.0.17
2 years ago
0.0.16
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago
0.0.0
2 years ago