@diam/json-db

2.0.2 • Public • Published

Simple JSON DB

Install (via npm)

npm install --save @diam/json-db

Usage

Simply writes json to a file.

var db = new JsonDB('./file.json');

db.write({ message: 'whatever you want' }, function (err) {
	db.read(function (err, val) {
		// val = { message: 'whatever you want' }
	})
})

It can also be done synchronously, like so:

var db = new JsonDB('./file.json');

db.writeSync({ message: 'whatever you want' })
var val = db.readSync()
// val = { message: 'whatever you want' }

Contributions welcome!

Credits

This library was initially made by the awesome team of engineers at Diamond.

If you haven't already, make sure you install Diamond!

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.2
    3
    • latest

Version History

Package Sidebar

Install

npm i @diam/json-db

Weekly Downloads

18

Version

2.0.2

License

MIT

Unpacked Size

30.6 kB

Total Files

7

Last publish

Collaborators

  • diam