Skip to content

tomarmayankk/cc-currency-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Currency Converter Node Package

A simple Node.js package for converting currencies using the cc-currency-converter library.

Installation

Install the package using npm:

npm install cc-currency-converter

Import

Import the package by using the following block of code

import { convertCurrency } from "cc-currency-converter";

Ussage

convertCurrency("USD", "INR", 4)
  .then((result) => {
    console.log(result);
  })
  .catch((error) => {
    console.error("Error:", error.message);
  });

API

convertCurrency(sourceCurrency, targetCurrency, amount)
Converts the given amount from the source currency to the target currency.

sourceCurrency: The currency code of the source currency (e.g., "USD").
targetCurrency: The currency code of the target currency (e.g., "INR").
amount: The amount to convert.
Returns a Promise that resolves to the converted amount.

Contributing

If you find a bug or have a feature request, please open an issue or submit a pull request. Contributions are welcome!

About

An npm package to convert currencies

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published