hide-secrets
var hide = var obj = innerObject: password: 'abc123' email: 'ben@npmjs.com' token: 'my-secret-token' auth: '' // empty strings are left empty. console
outputs
{
innerObject: {
password: '[SECRET]',
email: 'ben@npmjs.com',
token: '[SECRET]'
},
auth: ''
}
Currently the following fields are obfuscated by default:
password
, pass
, token
, auth
, secret
, passphrase
.
If you want to override this list of obfuscated terms, simply:
-
create your own list of terms:
const badWords ='super-secret-1' 'double-secret-probation' -
pass this as configuration to hide-secrets:
console
Any keys within obj that are contained within the badWords
array will be hidden.
License
ISC