0.1.0 • Published 3 years ago

jhowdb v0.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Links

See all functions below:

FunctionsExamples
.get()jdb.get("user")
.add()jdb.add("user", 100)
.remove()jdb.remove("user", 100)
.set()jdb.set("user", 50)
.delete()jdb.delete("user")
.all()jdb.all()
.pushjdb.push("a", "b")

Examples below:

Add

const db = require("jhowdb")
const jdb = new db("jhowdb.json") //File where it will be stored

jdb.add("user", 100)

//Or

jdb.add("user/money", 100)

Remove

const db = require("jhowdb")
const jdb = new db("jhowdb.json") //File where it will be stored

jdb.remove("user", 100)

//Or
jdb.remove("user/money", 100)

Get

const db = require("jhowdb")
const jdb = new db("jhowdb.json") //File where it will be stored

let value = jdb.get("user") //Also works the "/"
if(value === null) value = 0 //If you don't put this, or ternary, it will return null

console.log(`You have: ${value.money} coins!`)

Set

const db = require("jhowdb")
const jdb = new db("jhowdb.json") //File where it will be stored

jdb.set("guild", "Devcenter best botlist/programming server")

//Or
jdb.set("guild/info", "Devcenter best botlist/programming server")

Delete

const db = require("jhowdb")
const jdb = new db("jhowdb.json") //File where it will be stored

jdb.delete("guild")

//Or
jdb.delete("guild/info")

All

const db = require("jhowdb")
const jdb = new db("jhowdb.json") //File where it will be stored

console.log(jdb.all())
0.1.0

3 years ago

0.0.9

3 years ago

0.0.3

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago