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

connect-redis-realtime

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-redis-realtime

Internally-cached Redis session store for Connect, powered by PubSub

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

Connect Redis: Realtime

connect-redis-realtime is an extension of the connect-redis session store.

The difference is, this library is backed by an internal LRU cache to prevent excess network chatter on mildly-stable data. This cache is dynamically expired across nodes via redis built-in pubsub - perfect for realtime apps.

connect-redis is a Redis session store backed by node_redis, and is insanely fast :). Requires redis >= 2.0.0 for the SETEX command.

Installation

  $ npm install connect-redis-realtime

Options

  • max An integer containing the maximum number of sessions cacheable - set to at least your maximum-expected concurrent users. Defaults to Infinity.
  • client An existing redis client object you normally get from redis.createClient()
  • host Redis server hostname
  • port Redis server portno
  • ttl Session TTL in seconds
  • db Database index to use
  • pass Password for Redis authentication
  • prefix Key prefix defaulting to "sessions."
  • ... Remaining options passed to the redis createClient() method.

Usage

Pass connect to the function connect-redis-realtime exports in order to extend connect.session.Store:

var connect = require('connect')
 	  , RedisStoreRealtime = require('connect-redis-realtime')(connect);

connect()
  .use(connect.session({ store: new RedisStoreRealtime(options), secret: 'keyboard cat' }))

Express users may do the following, since express.session.Store points to the connect.session.Store function:

var RedisStoreRealtime = require('connect-redis-realtime')(express);

License

MIT

Thanks

Thanks to TJ Holowaychuk for connect-redis

To-Do

Full test coverage.

FAQs

Package last updated on 04 Apr 2013

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc