kyriosli / node-shared-cache

An interprocess shared LRU cache module for Node.JS
149 stars 30 forks source link

TypeError: cache.set is not a function #15

Closed 52cik closed 5 years ago

52cik commented 5 years ago

rt.

manueltimita commented 5 years ago

Because it isn't. I think the docs are a bit outdated. You could do:

const n = 'my-cache';
const b = cache.SIZE_512;
const c = 268435456;
const cacheObj = new cache.Cache(n, c, b);

// then either
cache.exchange(cacheObj, 'my_key', 'Foo');
// ... or
cacheObj[key] = 'Foo'

This an excellent cache solution for multi-process Node solutions. The only one, if I'm not mistaken.

52cik commented 5 years ago

thanks