fileobj

0.0.0 • Public • Published

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

Package Sidebar

Install

npm i fileobj

Weekly Downloads

1

Version

0.0.0

License

ISC

Last publish

Collaborators

  • frostme