Very simple key-value file storage with concurrent data change
$ npm install concfile --save
var ConcurrentStorage = require("concfile");
var storage = ConcurrentStorage('storage', __dirname);
This will create storage.json in current directory
Returns a new instance.
filename
- name of the file (without extension).
path
- directory, where file will be stored.
Get an item.
Get storage object.
Check existence if an item.
Set an item.
The key
must be string.
The value
must be JSON serializable.
The callback will receive the only argument (err).
Delete an item.
The callback will receive the only argument (err).
Deletes all keys.
The callback will receive the only argument (err).