akame.db

JSON database package, made by Lyertia

Usage no npm install needed!

<script type="module">
  import akameDb from 'https://cdn.skypack.dev/akame.db';
</script>

README

Examples

const db = require("akame.db")

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


db.deleteAll() // true

https://discord.gg/a6mBgqgSgG

Options

const db = require("akame.db")

db.setReadable(true) // It makes readable your JSON DB file.
db.setAdapter("yamldb") // It makes adapter as written adapter. Default adapter is JsonDB