0.0.3 • Published 2 years ago

eren.db v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

ErenDB

✨ a simple module that instantly stores your data as JSON

Examples

const erendb = require("eren.db")
const db = erendb({
    "dbName": "test", // Our DB file name.
    "dbFolder": "database", // Our DB folder name.
    "noBlankData": true,
    "readable": true,
});

db.set("x.y.z", "abc") // abc

db.get("x") // {y: {z: "abc"}}
db.all() // {x: {y: {z: "abc"}}}

db.push("a", "hello") //  ["hello"]
db.push("a", "world") //  ["hello", "world"]
db.unpush("a", "hello") // ["world"]

db.push("b", {test: "erendb"}) // [{test: "erendb"}]
db.push("b", {test2: "erendb2"}) // [{test: "erendb"}, {test2: "erendb2"}]
db.delByPriority("b", 1) // [{test2: "erendb"}]
db.setByPriority("b", {newtest:"hey this is edited"} 1) // [{newtest:"hey this is edited"}]

db.delete("x") // true
db.deleteAll() // true

db.getLength() // 8