import _ from 'lodash';
import { Low } from 'lowdb';
import { JSONFileSync } from 'lowdb/node';
const STORE_PATH = join(app.getPath('userData'), 'database.json');
let defaultData = {
tbl_setting: []
};
class LowWithLodash extends Low {
chain = _.chain(this).get('data');
};
const adapter = new JSONFile(STORE_PATH);
const db = new LowWithLodash(adapter, defaultData);
console.log(db.chain.get('tbl_setting').castArray().value())
join(app.getPath('userData'), 'database.json') is have data,butJSONFileSyncread is undefine, uesfs.readFileSync(STORE_PATH, 'utf8') || {};can read it but not write,how to fix it
join(app.getPath('userData'), 'database.json')
is have data,butJSONFileSync
read is undefine, uesfs.readFileSync(STORE_PATH, 'utf8') || {};
can read it but not write,how to fix itenv: electron22 lowdb7.0.1