@swapbills/xchange-rate
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -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 @@ |
{ | ||
"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. | ||
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
41364
7
1657
108