local-cache-json

1.0.1 • Public • Published

local-cache-json

Library for managing local cache with json data

Parameter description

config params:

  • path: local folder for the sorage
  • url: URL of global cache, e.g. shared by multiple projects
  • backPath: (optional) folder used for backups

manifest: a special DB contains meta data, e.g. for tracking local changes and sychronisation infos

Usage example

const { DbBase } = require('local-cache-json')
const path = require('path')

const resDir = path.join(__dirname, 'resources)
const db = new DbBase({ path: path.join(resDir, 'data.json') })

db.load()
const data = db.data || {}
data['newParam'] = 'parValus'
db.save(true, true)

TODO: Extend API description

Thanks

If you like our ideas and want to support further development, you can donate here:
Donate Donate

Readme

Keywords

Package Sidebar

Install

npm i local-cache-json

Weekly Downloads

45

Version

1.0.1

License

MIT

Unpacked Size

8.33 kB

Total Files

5

Last publish

Collaborators

  • simeonovp