Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FileSystemLocking

Use this backend service to help prevent race access to files on disk.

Hierarchy

  • FileSystemLocking

Index

Methods

Methods

  • lockPath<T>(lockPath: string, transaction: ((lockPath: string) => T | Promise<T>), thisArg?: unknown): Promise<T>
  • Get exclusive access to a file for reading and/or writing.

    Type Parameters

    • T

    Parameters

    • lockPath: string

      The path to request exclusive access to.

    • transaction: ((lockPath: string) => T | Promise<T>)

      The job to do while having exclusive access.

        • (lockPath: string): T | Promise<T>
        • Parameters

          • lockPath: string

          Returns T | Promise<T>

    • Optional thisArg: unknown

      this argument used when calling transaction.

    Returns Promise<T>