json-fs-query
    Preparing search index...

    Function cachedRead

    • The text of the file at location: from the cache when a call is running and the file was read (or written) during it, otherwise from read, kept for the rest of the call. A failed read isn't kept, so it fails (or succeeds) afresh the next time.

      Parameters

      • location: string

        The file's full location (see storagePath).

      • read: () => Promise<string>

        Reads the file's text from storage.

      Returns Promise<string>