Socket
Socket
Sign inDemoInstall

@swapbills/xchange-rate

Package Overview
Dependencies
74
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

lib/data.json

27

lib/xchange-service.js

@@ -124,2 +124,29 @@ 'use strict';

}()
}, {
key: 'getCurrencyInfo',
value: function () {
var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee4(query) {
return regeneratorRuntime.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
query = query.toLowerCase();
return _context4.abrupt('return', _data2.default.find(function (currency) {
return currency.code.toLowerCase() === query || currency.symbol.toLowerCase() === query || currency.symbol_native.toLowerCase() === query || currency.name_plural.toLowerCase() === query || currency.symbol_native.toLowerCase() === query;
}));
case 2:
case 'end':
return _context4.stop();
}
}
}, _callee4, this);
}));
function getCurrencyInfo(_x4) {
return _ref4.apply(this, arguments);
}
return getCurrencyInfo;
}()
}]);

@@ -126,0 +153,0 @@

2

package.json
{
"name": "@swapbills/xchange-rate",
"version": "1.1.0",
"version": "1.1.1",
"description": "A simple wrapper around google finance API for retrieving the exchange rate between two currencies, use at your own risk.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -9,1 +9,100 @@ # Exchange Rate Extractor

A simple wrapper around google finance API for retrieving the exchange rate between two currencies, use at your own risk.
### Usage
```js
import xChanger from '@swapbills/xchange-rate'
const xChangeService = xChanger()
const listAllCurrencies = xChangeService.getCurrencies()
const dollar = xChangeService.getCurrencyInfo('usd')
```
Development Quickstart
```
$ git clone https://github.com/swapbills/xchange-rate.git
$ cd xchange-rate
$ npm install
$ npm run start
```
## Development and Testing
### Source Code
The [xchange-rate source] is hosted on GitHub.
Clone the project with
```
$ git clone git@github.com:swapbills/xchange-rate.git
```
[xchange-rate source]: https://github.com/swapbills/xchange-rate
### Requirements
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
```
[Node.js]: https://nodejs.org/
[nvm]: https://github.com/creationix/nvm
### Tasks
Primary development tasks are defined under `scripts` in `package.json`
and available via `npm run`.
View them with
```
$ npm run
```
#### Production Build
Lint, test, and transpile the production build to `lib` with
```
$ npm run build
```
## License
This npm package is Copyright (c) 2016-2017 SwapBills Global.
## Warranty
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.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc