1.0.3 • Published 6 months ago

jsndb v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

jsndb

npm

a simple json object db

usage

npm i jsndb
const jsndb = require("jsndb");

const db = jsndb("your file path");

// directly set first level child will change to db file
db.foo = "bar";
db.arr = [1, 2, 3];
db.obj = { name: "test", value: 123 };

// now your file is:
// {
//    foo: "bar",
//    arra: [1, 2, 3]
//    obj: {name: "test", value: 123};
// }
//

// set second or 3rd ... level child will not change file
// because it is a deep change
db.arr[0] = "99";
db.obj.value = 456;

// !!! now your file is not change

// to make change to file, you need call save
db.save();

// now your file is:
// {
//    foo: "bar",
//    arra: [99 2, 3],
//    obj: {name: "test", value: 456};
// }
1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago