$ npm install loggd --save


Well, import the thing into your project, and give it a JSON file... Don't worry, it will make one for you if one doesn't already exists

const loggd = require("loggd");
const db = new loggd("/path/to/json/file.json")

It comes with one option, pretty It tells the package to store the JSON in a pretty format. It's true by default. But you can turn it off

const db = new loggd("/path/to/json/file.json", {pretty: false})

Alright, everything is set up, let's do something now...

Before we start, Promise me something

All the library methods return a Promise, And are then()able of course. Also remember to .catch() those errors

results matching ""

    No results matching ""