# currency-converter-rate

> [![npm version](https://badge.fury.io/js/currency-converter-rate.svg)](https://badge.fury.io/js/currency-converter-rate)

Latest version **0.0.2** (published 2024-03-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install currency-converter-rate
pnpm add currency-converter-rate
yarn add currency-converter-rate
bun add currency-converter-rate
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2024-03-25 |
| First published | 2024-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 16.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Amool-kk |
| Maintainers | amool |
| Keywords | currency, exchange, rate, converter, currency-converter, currency-exchange, real-time, google-search |

## Links

- npm: https://www.npmjs.com/package/currency-converter-rate
- Repository: https://github.com/Amool-kk/currency-converter-rate
- Homepage: https://github.com/Amool-kk/currency-converter-rate#readme
- Issues: https://github.com/Amool-kk/currency-converter-rate/issues
- npm.io page: https://npm.io/package/currency-converter-rate

## Dependencies (2)

- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.12
- [unirest](https://npm.io/package/unirest.md) ^0.6.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2024-03-25
- 0.0.1 — 2024-03-25

## README

# Currency Exchange Rate (CCR) Package

[![npm version](https://badge.fury.io/js/currency-converter-rate.svg)](https://badge.fury.io/js/currency-converter-rate)

This package provides a simple interface to fetch real-time currency exchange rates from Google search results.

## Installation

You can install the package using npm:

```bash
npm install currency-converter-rate
```

## Usage

```javascript
const { CCR } = require('currency-converter-rate');

async function getExchangeRate(fromCurrency, toCurrency, decimalPlaces) {
  try {
    const rate = await CCR({ fromCurrency, toCurrency, decimalPlaces });
    console.log(`1 ${from} is equal to ${rate} ${to}`);
  } catch (error) {
    console.error('Failed to get exchange rate:', error);
  }
}

getExchangeRate('USD', 'EUR', 2);
```

## API

### `CCR({ from: string, to: string, afterDecimal?: number }): Promise<number>`

- `from`: The currency code to convert from (e.g., 'USD').
- `to`: The currency code to convert to (e.g., 'EUR').
- `afterDecimal`: (Optional) The number of decimal places to round the exchange rate to. Default is 2.

Returns: A `Promise` that resolves to the exchange rate as a `number`.

## Keywords

- currency
- exchange
- rate
- converter
- currency-converter
- currency-exchange
- real-time
- google-search

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

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