Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Latest commit

 

History

History
50 lines (32 loc) · 897 Bytes

README.md

File metadata and controls

50 lines (32 loc) · 897 Bytes

fileobj

Node.js module to handle saving, serializing, and reading an object to and from a file.

Installation

npm install fileobj

Usage

Instantiation

dirname is the directory name where you plan on storing the file data.

var fileObj = require('fileobj')(dirname);

Save

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).

Read

fileObj.read(id, cb);
  • id : id of the file you wish to open.
  • cb : callback that accepts two parameters, err and object (object read).

All

fileObj.all(cb);
  • cb : callback that accept two parameters, err ids (array of id's of all files).

Author

M. Elliot Frost, CEO and President of Frostware Technical Solutions, LLC