1.0.5 • Published 5 years ago

redakt v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Redakt Object

Installation

# With Yarn
yarn add redakt

# With NPM 
npm install redakt

Usage

import redakt from 'redakt';

const objWithSecrets = {
  password: 'THISISMYPASSWORD',
};

const redactedObject = redakt(objWithSecrets, {
  enabled: true,
  replace: '[REDACTED]',
  keys: [
    'password',
  ],
});

console.log(redactedObject);
// {
//    password: '[REDACTED]'
// }

Parameters

Element Object or JSON

Redact's first parameter is the object or JSON string that you would like to recursively redact.

Options Object

Redact's second parameter is the options object.

ParameterTypeDefaultDescription
enabledBooleantrueEnable or disable redaction.
replaceString"[REDACTED]"String to replace redacted values.
keysArray[]List of keys to redact
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.0

5 years ago