# currencies-map

> Map from currency codes to currency names and symbols

Latest version **3.3.5** (published 2022-01-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install currencies-map
pnpm add currencies-map
yarn add currencies-map
bun add currencies-map
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.3.5 |
| Published | 2022-01-31 |
| First published | 2019-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 249.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | carlosvin@gmail.com |
| Maintainers | carlsa |
| Keywords | currency, currencies, localization, symbol, code, internationalization |

## Links

- npm: https://www.npmjs.com/package/currencies-map
- Repository: https://github.com/carlosvin/currencies-map
- npm.io page: https://npm.io/package/currencies-map

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 3.3.5 (latest) — 2022-01-31
- 3.3.4 — 2022-01-31
- 3.3.3 — 2022-01-31
- 3.3.0 — 2022-01-31
- 3.2.1 — 2019-11-28
- 3.2.0 — 2019-11-28
- 3.1.3 — 2019-11-26
- 3.1.2 — 2019-11-26
- 3.1.1 — 2019-11-26
- 3.1.0 — 2019-11-26
- 3.0.3 — 2019-11-26
- 3.0.2 — 2019-11-26
- 3.0.1 — 2019-11-26
- 3.0.0 — 2019-11-26
- 2.1.1 — 2019-11-25
- … 7 more at https://npm.io/package/currencies-map/versions

## README

# Currencies Map
Currency codes mapping to currency names and symbols using native javascript API to get local currency names and symbols.

[![alt text](https://badgen.net/bundlephobia/minzip/currencies-map "Bundle size")](https://bundlephobia.com/result?p=currencies-map)

It contains type declarations for Typescript.

It uses `navigator.language` to show the correct currency symbol or name.

## Example: Currency code `USD`
If your device language is `es-ES` you will get:
- Currency name: `dólares estadounidenses`
- Currency symbol: `US$`

If your device language is `en-GB` you will get:
- Currency name: `US dollars`
- Currency symbol: `US$`

# Install
```bash
yarn add currencies-map
```
or
```bash
npm install currencies-map
```

# Using it
```javascript
import {Currencies} from 'currencies-map';
```

## Getting currency name
```javascript
const currencyCode = 'EUR';
console.info(currencyCode + ': ' + Currencies.names.get(currencyCode));
```
Output (device language es-ES)
```javascript
"EUR: euros"
```

## Getting currency symbol
```javascript
const currencyCode = 'EUR';
console.info(currencyCode + ': ' + Currencies.symbols.get(currencyCode));
```
Output
```javascript
"EUR: €"
```

## List all names
```javascript
console.info([...Currencies.names.values()]);
```
Output (device language es-ES)
```javascript
["euros", "dólares estadounidenses", "kiats" ...]
```

## List all symbols
```javascript
console.info([...Currencies.symbols.values()]);
```
Output
```javascript
["€", "US$", "MMK" ...]
```
When the currency doesn't have symbol it will show currency code.

## List all currency codes
```javascript
import {CODES} from 'currencies-map';
console.info(CODES);
```
Output
```javascript
["EUR", "USD", "MMK" ...]
```

---
_Source: https://npm.io/package/currencies-map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
