flashheart
Advanced tools
Comparing version 2.5.3 to 2.6.0
@@ -16,1 +16,3 @@ var Client = require('./lib/client'); | ||
}; | ||
module.exports.Client = Client; |
{ | ||
"name": "flashheart", | ||
"version": "2.5.3", | ||
"version": "2.6.0", | ||
"description": "A fully-featured REST client built for ease-of-use and resilience", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,2 +28,3 @@ # flashheart | ||
* [Circuit breaker](#circuit-breaker) | ||
* [Promises](#promises) | ||
@@ -221,2 +222,17 @@ ## Usage | ||
### Promises | ||
Flashheart uses callbacks, but we expose the `Client` constructor to make it easy to [promisify](http://bluebirdjs.com/docs/api/promisification.html) the entire library: | ||
```js | ||
const Promise = require('bluebird'); | ||
const Client = require('flashheart').Client; | ||
const client = require('flashheart').createClient(); | ||
Promise.promisifyAll(Client.prototype); | ||
client.getAsync('http://httpstat.us/200') | ||
.then((body) => console.log(body)); | ||
``` | ||
## API | ||
@@ -223,0 +239,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
271591
1525
330