const Low = require('lowdb'); class SyncAdapter { read() {return {}}//初始化为对象才能db.defaults write(data) { /* ... */ } // should return nothing } const adapter = new SyncAdapter(); const db = new Low(adapter); // Set some defaults db.defaults({ posts: [1], user: {} }).write(); console.log(db.get('posts').value() );
原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/269484.html