JSON-based database for JavaScript
Go to file
2024-10-11 17:04:27 +00:00
.gitignore First commit 2022-07-16 14:22:26 -06:00
index.js Update 'index.js' 2022-08-05 21:04:37 +02:00
LICENSE Upload files to "/" 2024-10-11 17:04:27 +00:00
package.json First commit 2022-07-16 14:22:26 -06:00
README.md Update 'README.md' 2022-08-05 21:10:54 +02:00
test.js Update 'test.js' 2022-08-05 21:09:31 +02:00

jsondb

jsondb is a way to use JSON as a NoSQL database. It uses an ORM and is the only way to interact with the database.

Loading a database

All you need to do is to use loadDB. Here is an example:

let { DB } = require("jsondb");
let db = new DB("db.json");

Setting values

You do it just like any JavaScript object. Here is an example:

db.v["bits"] = 64;
db.v.bits = 64; // this also works
db.update();

Getting values

Again, it's just like any JS object. Here is an example:

let bits = db.v["bits"];
bits = db.v.bits; // that also works