
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@swapbills/xchange-rate
Advanced tools
A simple wrapper around google finance API for retrieving the exchange rate between two currencies, use at your own risk.
A simple wrapper around google finance API for retrieving the exchange rate between two currencies, use at your own risk.
import xChanger from '@swapbills/xchange-rate'
const xChangeService = xChanger()
const listAllCurrencies = await xChangeService.getCurrencies()
/*
[{
"symbol":"AED",
"name":"United Arab Emirates Dirham",
"symbol_native":"د.إ.",
"decimal_digits":2,
"rounding":0,
"code":"AED",
"name_plural":"UAE dirhams"
}, ... ] about 168 objects in a list
*/
const dollarInfo = await xChangeService.getCurrencyInfo('usd')
/*
{
"symbol":"$",
"name":"US Dollar",
"symbol_native":"$",
"decimal_digits":2,
"rounding":0,
"code":"USD",
"name_plural":"US dollars"
}
*/
const dollarToCediRate = await xChangeService.getRate('ghs','usd')
/*
4.30
*/
const chartUri = await xChangeService.getChartUri('ghs','usd')
/*
https://www.google.com/finance/getchart?x=CURRENCY&p=1Y&i=86400&q=GHSUSD
*/ visit this uri and you see a trend chart
Development Quickstart
$ git clone https://github.com/swapbills/xchange-rate.git
$ cd xchange-rate
$ npm install
$ npm run start
The xchange-rate source is hosted on GitHub. Clone the project with
$ git clone git@github.com:swapbills/xchange-rate.git
You will need Node.js.
Be sure that all commands run under the correct Node version, e.g., if using nvm, install the correct version with
$ nvm install
and set the active version for each shell session with
$ nvm use
Install the development dependencies with
$ npm install
Primary development tasks are defined under scripts
in package.json
and available via npm run
.
View them with
$ npm run
Lint, test, and transpile the production build to lib
with
$ npm run build
This npm package is Copyright (c) 2016-2017 SwapBills Global.
This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
FAQs
A simple wrapper around google finance API for retrieving the exchange rate between two currencies, use at your own risk.
The npm package @swapbills/xchange-rate receives a total of 0 weekly downloads. As such, @swapbills/xchange-rate popularity was classified as not popular.
We found that @swapbills/xchange-rate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.