@lgriffin/esi.ts - EVE Online ESI API Client - v12.3.0
    Preparing search index...

    JSON-file ITokenStorage.

    Writes go to a sibling temporary file that is renamed over the target, so a crash mid-write leaves the previous file intact. Writes are serialised within the process. Without the lock option, two processes sharing one file are not supported: each would rotate refresh tokens the other cannot see. With it, the storage provides ITokenStorage.withLock and the processes take turns.

    Implements

    Index
    withLock?: <T>(characterId: number, fn: () => Promise<T>) => Promise<T>

    Present only when the lock option is on, so the token manager treats an unlocked storage exactly as before.

    • get lockPath(): string

      Absolute path of the advisory lock file that writes take when lock is on. A refresh holds a separate lock file per character, <path>.<characterId>.lock.

      Returns string