0.1.2 • Published 10 years ago

redis-pages v0.1.2

Weekly downloads
5
License
ISC
Repository
github
Last release
10 years ago

#Redis Pages

Redis pages is a simply interface for caching page based content in redis.

##Usage

var redis = require('redis');
var redisPages = require('redis-pages');
var client = redis.createClient();

// An array of items
var items = [];

var params = {
  Client : client,
  Items : items,
  ItemsPerPage: 10,
  Key: 'MyKey',
  Stamp: null
}

redisPages.setPages(params, function(err, result) {
  if (err) {
    console.log(err);
  } else {
    console.log(result);
  }
});

##Documentation

setPages(params = {}, callback)

Caches pages. Note currently you cannot overwrite an existing key with setPages(). You must call deletePages() before doing so. Overwriting will be included in future updates.

######Parameters

  • Client - A redis client.
  • Items - An Array of String items to cache.
  • ItemsPerPage - An Int value denoting the number of items in each page.
  • Key - A String denoting the name of the item in the cache.
  • Stamp - An optional String or Integer to differentiate each key.
getPage(params = {}, callback)

Returns a single page.

######Parameters

  • Client - A redis client.
  • Key - A String denoting the name of the item in the cache.
  • Index - An Integer value denoting the index of the page content. Starts from 0.
deletePages(params = {}, callback)

Deletes a group of pages.

######Parameters

  • Client - A redis client.
  • Key - A String denoting the name of the item in the cache.
  • Stamp - An optional String or Integer to differentiate each key.

##Installation npm install redis-pages

##Author Lawrence Tran

##License See the LICENSE file for more info.

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago