0.1.2 • Published 1 year ago
sad-db v0.1.2
Example
const { SadDB } = require("sad-db")
const Database = new SadDB() //file is optional: new SadDB("filePath")
Database.sadSum("example", 5) //sum +5 in key "example", if not exists, the value of "example" will be 5
Database.sadSub("example", 5) //sub -5 in key "example", if not exists, the value of "example" will be -5
Database.sadAll() //will list all key values in the file .json
Database.sadGet("example") //will return key value from "example" in file .json
Database.sadDelete("example") //remove key "example" from the file .json
Other functions
const SadUtils = require("sad-db")
SadUtils.randomInt(0, 10) //will generate random number between 0-10
SadUtils.randomItem(["hello", "hi"]) //will return one random element from the give array