Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redakt

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redakt

## Installation ```bash # With Yarn yarn add redakt

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 21 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc