# redakt

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

Latest version **1.0.5** (published 2019-06-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install redakt
pnpm add redakt
yarn add redakt
bun add redakt
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-06-21 |
| First published | 2019-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dak Washbrook |
| Maintainers | vinlock |

## Links

- npm: https://www.npmjs.com/package/redakt
- Repository: https://github.com/Vinlock/redakt-js
- Homepage: https://github.com/Vinlock/redakt-js#readme
- Issues: https://github.com/Vinlock/redakt-js/issues
- npm.io page: https://npm.io/package/redakt

## Recent versions

- 1.0.5 (latest) — 2019-06-21
- 1.0.4 — 2019-06-21
- 1.0.3 — 2019-06-21
- 1.0.2 — 2019-06-21
- 1.0.0 — 2019-06-21

## README

# Redakt Object

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

# With NPM 
npm install redakt
```

## Usage
```js
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.

| 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 |

---
_Source: https://npm.io/package/redakt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
