currencylayer-client
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "currencylayer-client", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A nodejs client to consume the CurrencyLayer API for exchange rates & currency conversion", | ||
@@ -9,21 +9,21 @@ "main": "index.js", | ||
"lint": "eslint .", | ||
"test": "istanbul cover _mocha", | ||
"test": "nyc _mocha", | ||
"coveralls": "cat ./coverage/lcov.info | coveralls" | ||
}, | ||
"dependencies": { | ||
"bluebird": "3.5.0", | ||
"lodash": "4.17.4", | ||
"moment": "2.18.1", | ||
"request": "2.81.0", | ||
"request-promise": "4.2.1" | ||
"bluebird": "^3.5.5", | ||
"lodash": "^4.17.15", | ||
"moment": "^2.24.0", | ||
"request": "^2.88.0", | ||
"request-promise": "^4.2.4" | ||
}, | ||
"devDependencies": { | ||
"chai": "4.0.2", | ||
"chai-as-promised": "7.0.0", | ||
"coveralls": "2.13.1", | ||
"eslint": "4.0.0", | ||
"istanbul": "0.4.5", | ||
"mocha": "3.4.2", | ||
"sinon": "2.3.4", | ||
"sinon-chai": "2.11.0" | ||
"chai": "^4.2.0", | ||
"chai-as-promised": "^7.1.1", | ||
"coveralls": "^3.0.6", | ||
"eslint": "^6.1.0", | ||
"mocha": "^6.2.0", | ||
"nyc": "^14.1.1", | ||
"sinon": "^7.4.1", | ||
"sinon-chai": "^3.3.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "repository": { |
@@ -33,7 +33,43 @@ [![Build Status](https://travis-ci.org/baldercm/currencylayer-client.svg?branch=master)](https://travis-ci.org/baldercm/currencylayer-client) | ||
All client mehtods return: | ||
- a promise resolved with the full response for `success=true` responses | ||
All client methods return a (bluebird) Promise: | ||
- a promise resolved with the full response body for `success=true` responses | ||
```javascript | ||
// succesfull response resolves with body | ||
{ | ||
"success": true, | ||
"terms": "https://currencylayer.com/terms", | ||
"privacy": "https://currencylayer.com/privacy", | ||
"timestamp": 1432400348, | ||
"source": "USD", | ||
"quotes": { | ||
"USDAUD": 1.278342, | ||
"USDEUR": 0.908019, | ||
"USDGBP": 0.645558, | ||
"USDPLN": 3.731504 | ||
} | ||
} | ||
``` | ||
- a promise rejected with an error holding the code and info for `success=false` responses | ||
```javascript | ||
// fail response rejects with error | ||
{ | ||
"success": false, | ||
"error": { | ||
"code": 104, | ||
"info": "Your monthly usage limit has been reached. Please upgrade your subscription plan." | ||
} | ||
} | ||
client.live() | ||
.catch(err => { | ||
console.log(err.code) // 104 | ||
console.log(err.message) // Your monthly usage limit has been reached... | ||
}) | ||
``` | ||
### `live({currencies, source})` | ||
@@ -40,0 +76,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20328
145
14
+ Addedajv@6.12.6(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmoment@2.30.1(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.13.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedrequest-promise@4.2.6(transitive)
+ Addedrequest-promise-core@1.1.4(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addeduri-js@4.4.1(transitive)
- Removedajv@4.11.8(transitive)
- Removedassert-plus@0.2.0(transitive)
- Removedaws-sign2@0.6.0(transitive)
- Removedbluebird@3.5.0(transitive)
- Removedboom@2.10.1(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedco@4.6.0(transitive)
- Removedcryptiles@2.0.5(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedform-data@2.1.4(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhar-schema@1.0.5(transitive)
- Removedhar-validator@4.2.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhawk@3.1.3(transitive)
- Removedhoek@2.16.3(transitive)
- Removedhttp-signature@1.1.1(transitive)
- Removedisarray@2.0.5(transitive)
- Removedjson-stable-stringify@1.1.1(transitive)
- Removedjsonify@0.0.1(transitive)
- Removedlodash@4.17.4(transitive)
- Removedmoment@2.18.1(transitive)
- Removedoauth-sign@0.8.2(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedperformance-now@0.2.0(transitive)
- Removedpunycode@1.4.1(transitive)
- Removedqs@6.4.1(transitive)
- Removedrequest@2.81.0(transitive)
- Removedrequest-promise@4.2.1(transitive)
- Removedrequest-promise-core@1.1.1(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsntp@1.0.9(transitive)
- Removedstringstream@0.0.6(transitive)
- Removedtough-cookie@2.3.4(transitive)
Updatedbluebird@^3.5.5
Updatedlodash@^4.17.15
Updatedmoment@^2.24.0
Updatedrequest@^2.88.0
Updatedrequest-promise@^4.2.4