Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

src

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

src

Simple Redis Cache

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
52K
decreased by-3.7%
Maintainers
1
Weekly downloads
 
Created
Source

src

Simple Redis Cache Build Status

###Usage

src takes one hash parameter with url and expiry defined. Expiry is the number of seconds a value is non expired in Redis.

var src = require('src');
var cache = src(
  {
    url:'redis://user:password@example.com:9073/'
    ,expiry:2
  }
);

Callbacks for set are optional

cache.set('key', 'value', [cb]);

get requires a callback

cache.get('key', function(err, value){
  if(typeof value !== 'undefined')
    console.log(value);
});

If the key has expired, err will not be used to determine this. Err will only be a non null value when an error is thrown from Redis.

If you want to delete a key from the cache explicity src provides this functionality through cache.del

Callbacks are optional for del

cache.del('key', [cb]);

Keywords

FAQs

Package last updated on 22 Feb 2014

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