happner-client
Advanced tools
Comparing version
@@ -78,2 +78,6 @@ (function (isBrowser) { | ||
HappnerClient.prototype.dataClient = function(){ | ||
return this.__connection.client; | ||
}; | ||
HappnerClient.prototype.mount = function (orchestrator) { | ||
@@ -80,0 +84,0 @@ var _this = this; |
@@ -83,3 +83,3 @@ (function (isBrowser) { | ||
callback() | ||
callback(); | ||
}); | ||
@@ -86,0 +86,0 @@ }; |
{ | ||
"name": "happner-client", | ||
"version": "5.0.2", | ||
"version": "5.1.0", | ||
"description": "The client for happner-2 and happner cluster services", | ||
@@ -22,3 +22,3 @@ "main": "index.js", | ||
"bluebird": "^3.5.0", | ||
"happn-3": "^7.0.0" | ||
"happn-3": "^7.2.0" | ||
}, | ||
@@ -28,3 +28,3 @@ "devDependencies": { | ||
"expect.js": "^0.3.1", | ||
"happner-2": "^8.0.0", | ||
"happner-2": "^8.2.0", | ||
"istanbul": "^0.4.5", | ||
@@ -31,0 +31,0 @@ "mocha": "^3.5.0" |
@@ -98,3 +98,3 @@ [](https://www.npmjs.com/package/happner-client)[](https://travis-ci.org/happner/happner-client)[](https://coveralls.io/github/happner/happner-client?branch=master) | ||
] | ||
} | ||
} | ||
} | ||
@@ -125,2 +125,24 @@ } | ||
### Access happn data points directly, via the dataClient | ||
```javascript | ||
//assuming we have connected | ||
//var client = new HappnerClient(... | ||
//client.connect(... | ||
var dataClient = client.dataClient(); | ||
//dataClient is the underlying happn-3 client for the happner-client connection, so you have all the happn-3 goodness: | ||
dataClient.on('/test/point', function(data){ | ||
}).then(...); | ||
dataClient.set('/test/point', {my: 'data'}).then(...) | ||
dataClient.get('/test/point').then(...) | ||
dataClient.remove('/test/point').then(...) | ||
``` | ||
see [this test](https://github.com/happner/happner-client/blob/master/test/24-func-data.js) for a full demonstration | ||
## Browser usage | ||
@@ -136,3 +158,3 @@ | ||
<title>Title</title> | ||
<!-- includes Happner.HappnerClient --> | ||
@@ -174,3 +196,3 @@ <script src="/api/client"></script> | ||
}); | ||
// repeat call on exchange | ||
@@ -194,2 +216,1 @@ setInterval(function () { | ||
``` | ||
@@ -46,4 +46,8 @@ 1.1.6 2017-03-21 | ||
5.0.2 2015-05-29 | ||
5.0.2 2018-05-29 | ||
---------------- | ||
- onward release of happner-2 | ||
5.1.0 2018-06-08 | ||
---------------- | ||
- new dataClient() access to actual happn-3 client |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
212
10.99%0
-100%79427
-72.4%19
-55.81%1902
-76.87%Updated