Functions

f
cleanupDir(dirPath: string): Promise<void>

Kills all surviving processes that reference dirPath (checked via cwd, cmdline, and open file descriptors), then retries fs.rm() until it succeeds or a 5-second deadline expires. Re-scans /proc on each failed rm() attempt to catch processes that appear after the initial scan (e.g. late-forked Chrome helpers).

Usage

import * as mod from "lib/chrome/cleanup-dir.ts";