flat-file-cache
Storing objects in a flat file as JSON
Installing from npm
$ npm install flat-file-cache
Using it
-
Require the flat-file-cache class
var Flat = require('flat-file-cache');
-
Create a new cache object. The only parameter is the directory to use
var cache = new Flat('storage');
-
Storing data
cache.set('keyname', {my: data}, function callback(err) {});
-
Getting data
cache.get('keyname, function callback(result) {});
-
Sync
There is also a setSync() and getSync() version.