mediaforge - v2.2.0
    Preparing search index...

    Function withAtomicOutput

    • Run fn against a temporary path and publish the result only on success.

      Type Parameters

      • T

      Parameters

      • target: string

        Final path the caller wants.

      • fn: (tempPath: string) => T | Promise<T>

        Receives the temp path to write to. Its return value is passed through unchanged.

      • options: AtomicOutputOptions = {}

      Returns Promise<T>

      when target cannot be written atomically.