1.0.3 • Published 4 years ago
rf-ez-database v1.0.3
rf-ez-database
a simple JSON database tool based on data-store
const Database = new Database("./testdb.json")
const db = new Database({
name: "testdb",
path: "./testdb.json",
log: false
})
db.name().then(console.log)
// testdb
db.set("hello", "world").then(console.log)
// world
db.get("hello").then(console.log)
// world
db.has("hello").then(console.log)
// true
db.add("testArray", "item1").then(console.log)
// [ "item1" ]
db.clear("testArray").then(console.log)
./testdb.json
:
{
"__name": "test db",
"hello": "world",
"testArray": [
"item1"
]
}