Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
koa-rethinkdb
Advanced tools
Readme
Koa middleware that gets you a RethinkDB client via connection pool.
It handles acquire and release connection automatically.
npm install --save koa-rethinkdb
var rethinkdbPool = require('koa-rethinkdb');
var options = {
host:'localhost',
port:28015,
db:'marvel',
authKey:'hunter2'
};
app.use(rethinkdbPool(options, maxConcurrentConnection || 10, minConcurrentConnection || 2, idleTimeoutMillis || 30000));
var rethinkdbPool = require('koa-rethinkdb');
var r = require('rethinkdb');
var chan = require('chan');
app.use(rethinkdbPool(options));
app.use(function *(next) {
// get the list of table
var ch1 = chan();
var query1 = r.db('test').tableList().run(this.rethinkdb, ch1);
var list = yield ch1;
// select a few documents
ch2 = chan();
r.db('test').table('foobar').limit(10).run(this.rethinkdb, ch2);
cursor = yield ch2;
result = yield cursor.toArray;
yield next;
// connections are released back to the pool.
});
MIT
FAQs
Koa middleware that gets you a RethinkDB client
The npm package koa-rethinkdb receives a total of 6 weekly downloads. As such, koa-rethinkdb popularity was classified as not popular.
We found that koa-rethinkdb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.