A conservative offline redactor for exported browser-error JSON. It does not send telemetry. Free-form messages, URLs, stack strings and all nested context scalars become [redacted]. Untrusted context keys become ordinal field0, field1, etc., preserving array/object shape without echoing names or values. Safe numeric line/column location can be retained by policy.
This walkthrough uses the tool's public README and checked-in example files. Run the command from a repository checkout with Node.js 22+; inspect the source before using it on your own files.
Run the checked-in example
node bin/frontend-error-payload-scrubber.mjs --root examples/passing --policy policy.json --payload payload.json
node bin/frontend-error-payload-scrubber.mjs --root examples/failing --policy policy.json --payload payload.jsonRead the result
The first exits 0 with a redacted report. The second exits 2/incomplete because the exported payload declares partial coverage. @policy and @payload are logical source roles; JSON pointers identify fields within the exact files supplied at invocation. No input path or raw error content is printed.
Where this check stops
Payload 1,048,576 bytes; policy 65,536 bytes; JSON depth 16; 1,000 error records; 10,000 total JSON nodes including scalars; 5,000 ms evaluation time from an injected clock. Limits are inclusive; N+1 yields incomplete for payload evidence, or invalid configuration for an oversized policy. UTF-8 is decoded strictly. Inputs are realpath-confined within the declared root; the tool writes no files and uses no network. This is not a browser SDK, source map decoder, or a replacement for upstream data minimization. The library exports TOOLID, LIMITS, RULES, validPolicy and pure scrubPayload(payload, policy, {now, deadline}).
Before adapting the command to your own workflow, review the accepted inputs, exit codes and safety boundaries in the README.
Compiled with AI assistance from checked-in public documentation and example scripts. Run the example and review the repository's current documentation before relying on its result.