npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

seneca-redis-store-expires

v0.1.0

Published

Redis storage layer for Seneca framework which supports key expiry

Downloads

6

Readme

Redis storage driver for Seneca which supports key expiry

Note that this plugin was originally forked from Seneca Redis Store. It was forked to a new plugin because:

  • the original plugin uses hset/hget under the hood
  • hset doesn't support expiry of individual fields
  • to support expires, a complete re-implementation of redis-store was necessary under the hood
  • redis-store-expires is implemented using individual keys (i.e. set vs hset) which can optionally be expired

So our advise on which plugin to use is simply follows:

  • if you don't want to expire keys use the original module (in theory it's a more efficient redis store due to the underlying hset/hget usage)
  • if you do want to expire keys, use this module

Expiry

This Redis store supports expires as follows:

  • you can pass a default 'expire' property into the seneca config, e.g.

    seneca.use({host:'localhost', port:6379, expire:10})

This will cause all Entites to expire in 10 seconds.

  • if no 'expire' property is passed, the default is 0 (do not expire).

  • it is possible to override the 'expire' property for individual Entities by passing 'entityspec' into the configuration, e.g.

var entityspec = {
  '-/-/shortExpiringEntity': {
    expire: 2
  },
  '-/-/noExpiringEntity': {
    expire: 0
  }
};

seneca.use({host:'localhost', port:6379, expire:10, entityspec: entityspec})

In our above example, all entities will expire by default in 10 seconds, with our two exceptions above, 'shortExpiringEntity' which will expire in 2 seconds, and 'noExpiringEntity' which will not expire at all.

It's also possible to set an expire on an individual entity instance itself:

var expireSeneca = si.delegate({expire$: 100})
var entity = si.make('myent',{data:222, id:2})

In this example, the expiry for 'myent' will be 100 seconds.

Tested on: Node 0.10.24, Seneca 0.5.15, Redis 2.8.5