An open API service indexing awesome lists of open source software.

https://github.com/itsprinceraj/npm-library-currency-converter

A lightweight and easy-to-use currency converter library for Node.js and JavaScript applications. This library allows you to convert between different currencies in real-time using up-to-date exchange rates. Perfect for financial applications, e-commerce sites, and any project that requires accurate currency conversions.
https://github.com/itsprinceraj/npm-library-currency-converter

modules npmjs vanila-javascript

Last synced: 2 months ago
JSON representation

A lightweight and easy-to-use currency converter library for Node.js and JavaScript applications. This library allows you to convert between different currencies in real-time using up-to-date exchange rates. Perfect for financial applications, e-commerce sites, and any project that requires accurate currency conversions.

Awesome Lists containing this project

README

          

# Currency Converter

A simple npm library to converting from one currency to another

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Parameters](#parameters)

## Installation

To install the library, run:

```bash
npm i optimal-currency-converter
```

## Usage

First, import the library and create an instance of the convertCurrency function:

```bash
import { convertCurrency } from 'currency-converter';

const currencyVal = convertCurrency('USD', 'INR', 1)
console.log(currencyVal)
```
## Parameters

- "baseCurrency" (string): The currency code you want to convert from (e.g., 'USD').
- "toCurrency" (string): The currency code you want to convert to (e.g., 'INR').
- "unit" (number): The amount you want to convert.