kash

Fast and efficient in-memory caching.

npm install kash
8 downloads in the last week
16 downloads in the last month

KASH

Fast and efficient in-memory caching for JavaScript

Build Status

Benchmarks

Benchmarks run on an early 2013 Macbook Pro: 2.7 GHz Intel Core i7, and 16 GB 1600 MHz DDR3

Installation

Using npm:

$ npm [-g] install kash

In Node.js:

var kash = require("kash");

Synopsis

setTimeout(function() {
  console.log(kash.get('foo'));
}, 101);

kash.set('foo', 'bar', 100);

console.log(kash.get('foo'));

Will print the following in the console:

bar
null

API

kash.set(key, value [, expires ])

Set a key with a value. Set expires to remove from cache after specified number of milliseconds. Defaults to 2000 ms.

kash.get(key)

Retrieve the value for the specified key. Returns null if key does not exist.

kash.del(key)

Deletes a key.

kash.flush()

Removes the cache of all contents.

kash.size()

Get the number of entries in the cache.

Author

twitter/matthewgh
Matthew Hudson
npm loves you