How to use the lowdb.default function in lowdb

To help you get started, we’ve selected a few lowdb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pharindoko / json-serverless / src / server / app / core.app.ts View on Github external
protected async setupStorage() {
    CoreApp.storage = await this.storageAdapter.init();
    CoreApp.adapter = await lowdb.default(CoreApp.storage);
  }
github pharindoko / json-serverless / src / server / core.ts View on Github external
private async initializeLayers() {
    const adapter = await lowdb.default(this.storage);
    const router = jsonServer.router(adapter);
    const middlewares = jsonServer.defaults({
      readOnly: this.appConfig.readOnly,
    });
    return { middlewares, router };
  }
github pharindoko / json-serverless / src / server / app / core.app.ts View on Github external
protected async initializeLayers() {
    if (
      CoreApp.adapter &&
      Object.entries(CoreApp.adapter).length === 0 &&
      CoreApp.adapter.constructor === Object
    ) {
      CoreApp.adapter = await lowdb.default(CoreApp.storage);
    }
    const router = jsonServer.router(CoreApp.adapter);
    const middlewares = jsonServer.defaults({
      readOnly: this.appConfig.readOnly,
    });
    return { middlewares, router };
  }

lowdb

Tiny local JSON database for Node, Electron and the browser

MIT
Latest version published 4 months ago

Package Health Score

83 / 100
Full package analysis