1.0.0 • Published 2 years ago
kauadb v1.0.0
KauaDB
Another simple JSON database
Example:
const KauaDB = require('kauadb')
const db = new KauaDB('./file.json') // The file should exists to work
// Methods
db.set("test", "wow") // { "test": "wow" }
db.get("test") // wow
db.delete("test") // {}
db.set("test", []) // { "test": [] }
db.add("test", 10) // { "test": [ 10 ] }
db.add("test", 100) // { "test": [ 10, 100 ] }
db.remove("test", 100) // { "test": [ 10 ] }
db.delete("test") // {}
db.set("test.another", { thing: { what: 1 }, thing2: { what: 2 } })
// { "another": { "thing": { "what": 1 }, "thing2": { "what": 2 } } }
db.array("test.another")
// [ { "what": 1 }, { "what": 2 } ]
1.0.0
2 years ago