Functions

f
borrowArgv(argv: string[]): Disposable

Replaces process.argv for the scope and restores the previous value on exit.

f
borrowEnv(overrides: Record<string, string | undefined>): Disposable

Applies overrides over process.env for the scope, then restores it exactly: keys added during the scope are dropped and changed values are put back.

Usage

import * as mod from "lib/utils/borrowed-globals.ts";