0.1.10 • Published 3 years ago
jsoneerdb v0.1.10
JSONEER
What Is Jsoneer?
Jsoneer Is A Package That Allows You To Use JSON As Database Easily.
Usage Of Jsoneer
const jsoneer = require("jsoneerdb")
const db = new jsoneer.DB("./path/to/database.json") // if you dont want to use custom database,leave it empty
Functions
const jsoneer = require("jsoneerdb")
const db = new jsoneer.DB("./datas.json")
db.set("key","value") // set key as value
db.fetch("key") // fetch the value of key
db.add("key",10) // add value to key
db.push("key","value") // push value to key array
db.subtract("key",10) // subtract value from key
Events
- dataSaved - Emitted when a data saved.
const jsoneer = require("jsoneerdb")
const db = new jsoneer.DB("./datas.json")
db.on("dataSaved",async(data) => {
console.log(data) // output:{key:event,currentvalue:"test",operation:"set"}
})
db.set("event","test ")
0.1.10
3 years ago