New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

currency-converter-lt

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

currency-converter-lt

A nodejs currency converter library that doesn't require subscribing to any API calls.

1.1.1
Source
npm
Version published
Weekly downloads
5.5K
11.71%
Maintainers
1
Weekly downloads
 
Created
Source

NodeJS Currency Converter

Build Status Known Vulnerabilities codecov license: MIT Maintainability npm version npm

A minimal currency converter library for NodeJS that works out of the box.

Getting started

Installation

This package can be installed using npm

npm install currency-converter-lt

or, yarn

yarn add currency-converter-lt

Usage

Import currency-converter-lt.

const CC = require('currency-converter-lt')

Then instantiate with either the empty constructor

let currencyConverter = new CC()

Or, with a json object

let currencyConverter = new CC({from:"USD", to:"JPY", amount:100})

The convert method will return the conversion based on the last conversion rate and can be used as a promise.

currencyConverter.convert().then((response) => {
    console.log(response) //or do something else
})

convert can also take the amount as a parameter.

currencyConverter.convert(100).then((response) => {
    console.log(response) //or do something else
})

To find the rates use the rates method.

currencyConverter.rates().then((response) => {
    console.log(response) //or do something else
})

Chaining is also supported.

currencyConverter.from("USD").to("GBP").amount(125).convert().then((response) => {
    console.log(response) //or do something else
})

Issues

If any issues are found, they can be reported here.

License

This project is licensed under the MIT license.

Keywords

currency

FAQs

Package last updated on 20 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts