New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hapi-rethinkdb

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-rethinkdb - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

CHANGES.md

7

index.js

@@ -28,5 +28,8 @@ 'use strict';

plugin.expose('client', conn);
plugin.expose('connection', conn);
plugin.expose('library', rethink);
plugin.bind({ rethinkdb: conn });
plugin.bind({
rethinkdbConn: conn,
rethinkdb: rethink
});

@@ -33,0 +36,0 @@ plugin.log(['hapi-rethinkdb', 'info'], 'RethinkDB connection established');

{
"name": "hapi-rethinkdb",
"version": "1.0.0",
"version": "2.0.0",
"description": "Hapi's rethinkdb plugin",

@@ -26,11 +26,12 @@ "main": "index.js",

"dependencies": {
"rethinkdb": "^1.16.2"
},
"devDependencies": {
"hapi": "^8.2.0",
"rethinkdb": "^2.0.0",
"mocha": "^2.1.0"
},
"peerDependencies": {
"hapi": "^8.2.0"
"hapi": "^8.2.0",
"rethinkdb": "^2.0.0"
}
}

@@ -6,2 +6,7 @@ hapi-rethinkdb

Install hapi-rethinkdb
----------------------
npm install --save rethinkdb hapi-rethinkdb
Register plugin

@@ -25,4 +30,18 @@ ---------------

The connection object returned by `rethinkdb.connect` callback is exposed on `server.plugins['hapi-rethinkdb'].client` and binded to the context on routes and extensions as `this.rethinkdb`. You can find the `rethinkdb` library itself exposed on `server.plugins['hapi-rethinkdb'].library`.
The connection object returned by `rethinkdb.connect` callback is exposed on `server.plugins['hapi-rethinkdb'].connection` and binded to the context on routes and extensions as `this.rethinkdbConn`. You can find the `rethinkdb` library itself exposed on `server.plugins['hapi-rethinkdb'].library` or binded to the context on routes and extensions as `this.rethinkdb`.
From a handler you can use it like:
function handler (request, response) {
var r = request.server.plugins['hapi-rethinkdb'].rethinkdb;
// r === this.rethinkdb;
var conn = request.server.plugins['hapi-rethinkdb'].connection;
// conn === this.rethinkdbConn;
r.table('example').run(conn, function (err, cursor) {
cursor.each(console.log);
});
}
License

@@ -33,2 +52,2 @@ -------

© 2015, jose-Luis Rivas `<me@ghostbar.co>`
© 2015, Jose-Luis Rivas `<me@ghostbar.co>`

@@ -22,9 +22,9 @@ /* global describe,it,afterEach,beforeEach */

}, function () {
assert(server.plugins['hapi-rethinkdb'].client, 'No RethinkDB client returned');
assert(server.plugins['hapi-rethinkdb'].connection, 'No RethinkDB connection returned');
assert(
server.plugins['hapi-rethinkdb'].client.host === 'localhost',
server.plugins['hapi-rethinkdb'].connection.host === 'localhost',
'Connected to incorrect address'
);
assert(
server.plugins['hapi-rethinkdb'].client.port === 28015,
server.plugins['hapi-rethinkdb'].connection.port === 28015,
'Connected to incorrect port'

@@ -40,3 +40,3 @@ );

}, function () {
assert(server.plugins['hapi-rethinkdb'].client.open, 'Did not connect');
assert(server.plugins['hapi-rethinkdb'].connection.open, 'Did not connect');
done();

@@ -52,7 +52,7 @@ });

assert(
server.plugins['hapi-rethinkdb'].client.host === 'localhost',
server.plugins['hapi-rethinkdb'].connection.host === 'localhost',
'Connected to incorrect address'
);
assert(
server.plugins['hapi-rethinkdb'].client.port === 28015,
server.plugins['hapi-rethinkdb'].connection.port === 28015,
'Connected to incorrect port'

@@ -70,7 +70,7 @@ );

assert(
server.plugins['hapi-rethinkdb'].client.host === 'localhost',
server.plugins['hapi-rethinkdb'].connection.host === 'localhost',
'Connected to incorrect address'
);
assert(
server.plugins['hapi-rethinkdb'].client.port === 28015,
server.plugins['hapi-rethinkdb'].connection.port === 28015,
'Connected to incorrect port'

@@ -77,0 +77,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