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.
- Host: GitHub
- URL: https://github.com/itsprinceraj/npm-library-currency-converter
- Owner: itsprinceraj
- Created: 2024-10-10T15:50:06.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-10T17:38:31.000Z (about 1 year ago)
- Last Synced: 2025-04-12T03:14:31.192Z (8 months ago)
- Topics: modules, npmjs, vanila-javascript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/optimal-currency-converter
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.