dbjsond
Quick and easy embeddable database for Node.js.
The module stores all the data within the in-memory representation and optionally saves it in JSON file.
Requirements
This module requires Node.js v6.*
Install
npm install dbjsond
Example
See example folder for more complex examples.
In-Memory
const dbjsond = db = ':memory'; db; // {'Name': 'Value', 'Name2': 'Value2'}db; // return Valuedb; // {}
File
const dbjsond = db = '/path/to/json'; db; // {'Name': 'Value', 'Name2': 'Value2'}db; // return Value db;
API
db // returns this
Adds a named value.
db // returns value
Returns a key value.
db // returns {}
Returns a full temp object or collection.
db // returns this
Removes a key.
db // returns this
Sets collection name (which is used by db.add() db.get() db.remove()).
db // returns this
Unsets collection name.
db // returns this
Removes collection from the database object.
db
Saves database object in file.
db
Starts database autosaving.
NOTE data must be db._tempMemory.
Contributor
License
dbjsond
is MIT licensed.