json-fs-query
    Preparing search index...

    Function readJson

    • Read and parse one JSON file of the database: from disk in Node, over fetch() in a browser (see storagePath for where it's looked for). During a statement, a file it has written or deleted is answered from its write set (see withWriteSet); otherwise, during a call, a file already read is answered from the read cache (see withReadCache).

      Parameters

      • path: string

        A path inside the database, such as users.json.

      Returns Promise<any>

      When the file can't be read or isn't valid JSON (the error from the file system, fetch or JSON.parse).