Node.js module to handle saving, serializing, and reading an object to and from a file.
npm install fileobj
dirname is the directory name where you plan on storing the file data.
var fileObj = require('fileobj')(dirname);
fileObj.save(obj, cb);
- obj : javascript object to be saved to file.
- cb : callback that accepts two parameters, err and id (id of the file, used to open).
fileObj.read(id, cb);
- id : id of the file you wish to open.
- cb : callback that accepts two parameters, err and object (object read).
fileObj.all(cb);
- cb : callback that accept two parameters, err ids (array of id's of all files).
M. Elliot Frost, CEO and President of Frostware Technical Solutions, LLC