docx-validate
    Preparing search index...

    Function withTempDir

    • Run fn with a fresh temporary directory; the directory is recursively removed afterwards (success or failure). Mirrors Python's with tempfile.TemporaryDirectory() as d: block.

      Use this everywhere — do not call tmp.dirSync / mkdtempSync inline.

      Type Parameters

      • T

      Parameters

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

      Returns Promise<T>