0.0.2 • Published 3 years ago

ibidb v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

ibiDB

a JSON database module

Examples

const ibidi = require("ibidb")
const db = new ibidi({
    "dbName": "test", // Our DB file name.
    "dbFolder": "database", // Our DB folder name.
    "noBlankData": true,
    "readable": true,
    "language": "en" // You can write "tr" or "en".
})

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: "ibidb"}) // [{test: "ibidb"}]
db.push("b", {test2: "ibidb2"}) // [{test: "ibidb"}, {test2: "ibidb2"}]
db.delByPriority("b", 1) // [{test2: "ibidb"}]
db.setByPriority("b", {newtest:"hey this is edited"} 1) // [{newtest:"hey this is edited"}]

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