![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Currency exhange api with auto caching of api calls for better performance and bandwidth utilization
__
/\ \
__ _ ___\ \ \___ __ ___ __ __ _ __
/\ \/'\ /'___\ \ _ `\ /'__`\ /' _ `\ /'_ `\ /'__`\/\`'__\
\/> <//\ \__/\ \ \ \ \/\ \L\.\_/\ \/\ \/\ \L\ \/\ __/\ \ \/
/\_/\_\ \____\\ \_\ \_\ \__/.\_\ \_\ \_\ \____ \ \____\\ \_\
\//\/_/\/____/ \/_/\/_/\/__/\/_/\/_/\/_/\/___L\ \/____/ \/_/
/\____/
\_/__/
Currency converter with auto caching of exchange rates from exchangeratesapi.io
Its really simple to use. Just require the module and create a new xchange instance.
const XCHANGER = require('xchanger')
const xchange = new XCHANGER() // or new XCHANGER(<currency code>)
xchange.setBase('inr') //Set the base exchange currency to use as a default
// Convert to currency specified as base currency
xchange.convert(100, 'usd').then(result => {
// Since we specified INR as base
// the converted result will be in INR
console.log(result)
}).catch(error => {
console.log(error)
})
// Convert from usd to aud
xchange.convert(100, 'usd', 'aud').then(result => {
console.log(result)
}).catch(error => {
console.log(error)
})
// Get a list of supported currency codes
xchange.getValidCodes()
The module itself exports a constructor from which and exchange object can be created. Each exchange object has the following methods available -
Currently the api provides support for the 33 currencies listed below -
Thats it!
This module uses exchangeratesapi.io to fetch rates and caches them for 30 minutes. There is no functionality to reduce that time as of now. Therefore, the converted results from this module may vary from the real time results. Furthermore, the fact that it depends on the external API means the author has no control over the rates returned and is therefore not liable for any damage, loss or failure due to the use of this module.
All that being said, if you are looking to convert currencies with reasonable accuracy and real time isnt really your use case, then go to town with this.
Created and maintained by Hanut Singh Gusain
FAQs
Currency exhange api with auto caching of api calls for better performance and bandwidth utilization
The npm package xchanger receives a total of 1 weekly downloads. As such, xchanger popularity was classified as not popular.
We found that xchanger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.