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

stella-cache

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

stella-cache

a thin api allowing you to create multiple cache stores using redis.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

stella-cache

a thin api allowing you to create multiple cache stores using redis.

Installation:

npm install stella-cache

Docs:

Contrived Example:

index.js:

// Initialize your app
var httpLoader = require('./httpLoader');
var dbLoader = require('./dbLoader');
var cacheLoader = require('./cacheLoader');

httpLoader.listen();

cacheLoader.js:

var cache = require('stella-cache'),
    httpCacheConfig = {},
    dbCacheConfig = {};

// stella-cache config options
httpCacheConfig = {
    name: 'httpCache',
    port: '6379',
    host: '10.10.10.1',
    options: {}
};

dbCacheConfig = {
    name: 'dbCache',
    port: '6379',
    host: '10.10.10.2',
    options: {return_buffers = true}
};

// create cache clients
cache.createCache(httpCacheConfig, function () {
    console.log(httpCacheConfig.name + ' created');
});

cache.createCache(dbCacheConfig, function () {
    console.log(dbCacheConfig.name + ' created');
});

someOtherFile.js

var db = require('someDB');
var dbCache = require('stella-cache').cacheStore.dbCache;

var user = db.get('12345', function (err, user) {
    
    var item: {
        expire: 30,
        key: user.userId
        value: {
            user: {
                userId: user.userId,
                username: user.username,
                note: 'Some notes.'
            }
        }
    }
            
    dbCache.put(item);
};

License

Copyright (c) 2013 Kevin J. Neff MIT License

Keywords

FAQs

Package last updated on 18 Nov 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