Socket
Socket
Sign inDemoInstall

koa-redis

Package Overview
Dependencies
4
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    koa-redis

koa session with redis


Version published
Weekly downloads
19K
decreased by-2.55%
Maintainers
1
Install size
240 kB
Created
Weekly downloads
 

Readme

Source

koa-redis Build Status Coverage Status Dependency Status

Redis storage for koa session middleware / cache.

NPM

Usage

koa-redis works with koa-sess(a session middleware for koa).

Example

var koa = require('koa');
var http = require('http');
var session = require('koa-sess');
var redisStore = require('koa-redis');

var app = koa();

app.name = 'koa-session-test';
app.keys = ['keys', 'keykeys'];

app.use(session({
  store: redisStore()
}));

app.use(function *() {
  this.session.name = 'koa-redis';
  this.body = this.session.name;
});

var app = module.exports = http.createServer(app.callback());
app.listen(8080);

Options

 * {Object} client    redis client
 * {String} host      redis connect host (without options.client)
 * {Number} port      redis connect port (without options.client)
 * {String} socket    redis connect socket (without options.client)
 * {String} db        redis db
 * {String} pass      redis password

Benchmark

ServerTransaction rateResponse time
connect without session6763.56 trans/sec0.01 secs
koa without session5684.75 trans/sec0.01 secs
connect with session2759.70 trans/sec0.02 secs
koa with session2355.38 trans/sec0.02 secs

Detail benchmark report here

Authors

$ git summary

 project  : koa-redis
 repo age : 6 weeks ago
 commits  : 27
 active   : 9 days
 files    : 16
 authors  :
    20  dead_horse              74.1%
     3  Jesse Yang              11.1%
     3  sipajahava              11.1%
     1  Alessandro Lensi        3.7%

Licences

(The MIT License)

Copyright (c) 2013 dead-horse and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Last updated on 27 Feb 2014

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc