Skip to main content

Function: removePasswordFromArgs()

removePasswordFromArgs(args): string

Redacts secrets from a spawn/exec argv for logging. Redacts per-argument, so a secret value that contains whitespace is hashed in full instead of leaking every token after the first — which is what happens when the argv is joined into one string first (the argument boundary is lost, and the flag pattern can only capture up to the next space). Inline forms (pass:value, /b … /c) still go through removePassword.

Parameters

args

string[]

Returns

string