Registry / storage / cache-storage

cache-storage

JSON →
library2.0.1jsnpmunverified

Abandoned Node.js caching library inspired by Nette framework, providing a unified interface for multiple storage backends (file, memory, Redis, browser local storage). Version 2.0.1 was the last release. No longer maintained since at least 2016. Requires Node >=0.9. Offers both synchronous and asynchronous storages with expiration features. Superseded by modern alternatives like node-cache, lru-cache, or ioredis-based caching.

npm install cache-storage
INSTALL
IMPORT
SIG · CACHE-STORAGE
C
cache-storage
storagejavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Cache
✓ var Cache = require('cache-storage');
✗ import Cache from 'cache-storage';
CommonJS require is the only supported pattern; the library does not support ESM imports.
FileSyncStorage
✓ var FileSyncStorage = require('cache-storage/Storage/FileSyncStorage');
✗ import FileSyncStorage from 'cache-storage/Storage/FileSyncStorage';
Storages are accessed via deep require paths. No ESM support.
RedisAsyncStorage
✓ var RedisAsyncStorage = require('cache-storage/Storage/RedisAsyncStorage');
✗ import { RedisAsyncStorage } from 'cache-storage';
Redis storage requires manual dependency on the 'redis' package (version 0.8.x) as a peer dependency.

Shows synchronous cache usage with file storage, manual load/save, and fallback function.

var Cache = require('cache-storage'); var FileSyncStorage = require('cache-storage/Storage/FileSyncStorage'); var cache = new Cache(new FileSyncStorage('./temp'), 'myapp'); var data = cache.load('some_key'); if (data === null) { data = cache.save('some_key', 'Hello World', { expiration: 3600 }); } console.log(data); // Using fallback var result = cache.load('another_key', function() { return 'computed value'; }); console.log(result);
Debug
Known issues
deprecatedThe package is abandoned and no longer maintained. Do not use in new projects.
fix
Migrate to actively maintained caching libraries like node-cache, lru-cache, or cache-manager.
affects: >=0.0.0
breakingRequires Node.js >= 0.9. Modern Node.js versions may have compatibility issues.
fix
Use Node.js 0.9-0.12 or consider containerizing with an older Node version. Better: switch to a maintained library.
affects: >=0.0.0
gotchaRedisAsyncStorage depends on an old version of the 'redis' package (0.8.x). Installing a newer redis version may break compatibility.
fix
Explicitly install redis@0.8.x alongside cache-storage if using Redis storage.
affects: >=2.0.0
gotchaAll asynchronous methods use callbacks, not Promises. No promise or async/await support.
fix
Wrap callbacks in Promises manually or switch to a library with Promise support.
affects: >=0.0.0
gotchaThe package has no defined license. Legal usage may be uncertain.
fix
Avoid using in production or consult a lawyer. Prefer libraries with clear open-source licenses.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'cache-storage/Storage/FileSyncStorage'
The deep require path is case-sensitive and must match exactly.
fix
Ensure the path is correct: 'cache-storage/Storage/FileSyncStorage' (capital S).
Redis connection refused - errno: 111
RedisAsyncStorage expects a running Redis server on default port 6379.
fix
Start Redis server or configure connection settings correctly.
TypeError: cache.load is not a function
The Cache constructor expects a storage instance and a namespace string; incorrect arguments.
fix
Instantiate with: new Cache(new FileSyncStorage('./temp'), 'namespace');
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
28
Resources
cache-storage — npm install cache-storage · libregistry