Socket
Book a DemoInstallSign in
Socket

redis-cached

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-cached

A cache wrapper with redis

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Redis Cached

Provide a function wrapper for to cache return vals into redis.

Only support async calls.

Usage

var Redis = require('redis');
var Cached = require('redis-cached');

var client = Redis.createClient();
var cached = Cached(client, {
  ttl: 60000, // cache will expire in one minutes
  prefix: 'myapp-'
});


var getUser = function(user_id, callback) {

  // do something
  // ...

  callback(err, data);
}

getUser = cached.wrap(getUser, 'user-{0}');

Keywords

redis

FAQs

Package last updated on 21 Mar 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