Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

currencylayer-client

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

currencylayer-client - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

30

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc