Kizuki
    Preparing search index...

    Function withLock

    • Runs fn while holding a lock file, so writers take turns. A lock left by a process that has exited is taken over. Waiting longer than the timeout throws an error naming the process that holds the lock.

      Type Parameters

      • T

      Parameters

      • path: string
      • fn: () => Promise<T>
      • options: LockOptions = {}

      Returns Promise<T>