flat-file-cache

0.0.1 • Public • Published

flat-file-cache

Storing objects in a flat file as JSON

Installing from npm

$ npm install flat-file-cache

Using it

  1. Require the flat-file-cache class

    var Flat = require('flat-file-cache');

  2. Create a new cache object. The only parameter is the directory to use

    var cache = new Flat('storage');

  3. Storing data

    cache.set('keyname', {my: data}, function callback(err) {});

  4. Getting data

    cache.get('keyname, function callback(result) {});

  5. Sync

There is also a setSync() and getSync() version.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i flat-file-cache

      Weekly Downloads

      3

      Version

      0.0.1

      License

      MIT

      Last publish

      Collaborators

      • skerit