A library to 'blur' sensetive information for logging
npm install blur
`` javascript
var obj = {
creditcard: {
number: 'ABCDEFGHIJKLMNOP',
year: 17,
month: 4
}
};
var result = Blur(obj, { number: Blur.creditCard });
`
Will result in
` javascript`
{
creditcard: {
number: 'XXXXXXXXXXXXMNOP',
year: 17,
month: 4
}
}
Recursively operate on keys in an object to censor, remove or modify values in
some way to make it safe for logging.
- object - Object to operated onoptions
- - object describing keys to be modified where:
- - name of key to be modified, and value is type of operation
to be performed.
#### Operation types:
- Blur.creditCard - This option is used to set any string to show only the last four characters and blur out the rest with X'sBlur.remove
- - Completely removes all matching keysBlur.censor
- - Replaces all values matching keys with the string [BLURRED]`