elonadb
v1.0.5
Published
Fast and convenient remote database module!
Downloads
7
Maintainers
Readme
Fast and convenient remote database module!
const { DB } = require("elonadb");
const database = new DB("v1", "myDatabase", "user", "supersecretpassword"); (api version, database name, database user, user password)
.set (key, value) Set key value
database.set("whoIsAwesome", "you");
Set integer value
database.set("XP", "_i10")
.delete (key) Delete data
database.delete("whoIsAwesome")
.push (key, value) Add data to object
database.push("weapons", "Sword")
.increase (key value) Increase data
database.increase("user.money", 100)
.decrease (key, value) Decrease data
database.decrease("user.money", 50)
.get Get data
database.get("user.money")
.then(result => {
console.log(result.data)
})
.getAll Get all data in database
database.getAll()
.then(result => {
console.log(result.data)
})
.byte (key) Get size of key
database.byte("longText")
.then(result => {
console.log(result.data)
})
.has (key) Check if data exists
database.has("isPremium")
.then(result => {
console.log(result.data)
})
.typeOf (key) Get type of data
database.typeOf("money")
.then(result => {
console.log(result.data)
})
.databaseSize Get database size
database.databaseSize()
.then(result => {
console.log(result.data)
})
.info Get database information
database.info()
.then(result => {
console.log(result.data)
})