Path: blob/master/lib/lowdb/adapters/JSONFileSync.js
2591 views
//═══════════════════════════════════════════════════════//1//If you want to recode, reupload2//or copy the codes/script,3//pls give credit4//no credit? i will take action immediately5//© 2022 Xeon Bot Inc. Cheems Bot MD6//Thank you to Lord Buddha, Family and Myself7//════════════════════════════//8const { TextFileSync } = require('./TextFileSync.js');9class JSONFileSync {10constructor(filename) {11this.adapter = new TextFileSync(filename);12}13read() {14const data = this.adapter.read();15if (data === null) {16return null;17}18else {19return JSON.parse(data);20}21}22write(obj) {23this.adapter.write(JSON.stringify(obj, null, 2));24}25}26module.exports = { JSONFileSync };272829