1.0.2 • Published 2 years ago

bhbl.db v1.0.2

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

bhbl.db

Support: https://bhbotlist.xyz/dc NPM: npmjs.com/package/bhbl.db

const Database = require("bhbl.db");
const db = new Database("./db.json");

db.set('serverStatus', { status: 'Online' })
/*
"serverStatus": {
  "status": "Online"
}
*/
db.add("money_bhbl", 500)
/* 
  "money_bhbl": 500
*/
db.push("serverSettings", { whitelist: "on", playerCount: "24" })
/*
"serverSettings": [
    {
      "whitelist": "on",
      "playerCount": "24"
    }
  ]
*/
db.has("money_bhbl") // true
db.has("money_ibhbl") // false

db.get("money_bhbl")
// => 500

db.sub("money_bhbl", 100)
// => 400

db.fetch("serverStatus")
// => { status: "Online" }

db.get("serverStatus")
// => { status: "Online" }

db.delete("serverStatus")
// => {}

db.all()
/*
{
  money_bhbl: 500,
  serverSettings: [ { whitelist: 'on', playerCount: '24' } ]
}
*/

db.clear()
// {}

Installation

If you have trouble with the installation, please feel free to visit our discord address.

  • npm i bhbl.db