Redakt Object
Installation
# With Yarn yarn add redakt # With NPM npm install redakt
Usage
; const objWithSecrets = password: 'THISISMYPASSWORD'; const redactedObject = ; console;// {// password: '[REDACTED]'// }
Parameters
Object
or JSON
Element Redact's first parameter is the object or JSON string that you would like to recursively redact.
Object
Options Redact's second parameter is the options object.
Parameter | Type | Default | Description |
---|---|---|---|
enabled |
Boolean |
true |
Enable or disable redaction. |
replace |
String |
"[REDACTED]" |
String to replace redacted values. |
keys |
Array |
[] |
List of keys to redact |