# log-sanitizer

> sanitizes personal information in logs

Latest version **1.0.2** (published 2019-11-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install log-sanitizer
pnpm add log-sanitizer
yarn add log-sanitizer
bun add log-sanitizer
```

## 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.2 |
| Published | 2019-11-01 |
| First published | 2019-11-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Daren Liu |
| Maintainers | dliu74 |

## Links

- npm: https://www.npmjs.com/package/log-sanitizer
- npm.io page: https://npm.io/package/log-sanitizer

## Dependencies (1)

- [lodash.clonedeep](https://npm.io/package/lodash.clonedeep.md) ^4.5.0

## Recent versions

- 1.0.2 (latest) — 2019-11-01
- 1.0.1 — 2019-11-01
- 1.0.0 — 2019-11-01

## README

# **log-sanitizer**

### Description
Module that allows users to sanitize JSON data based on inputted fields, i.e. password, email, credit card information, etc.

### Requirements

### Installation
```
npm install log-sanitizer
```

### Usage
1. Import module

```
const Sanitize = require('log-sanitizer');
```

2. Initialize object with array of fields to be sanitized

```
const logSanitizer = new Sanitize(['password'])
```

3. Sanitize JSON object: Function takes in a JSON object and creates a deep copy that is sanitized based on the fields the user inputted during initialization and returned.

```
const sanitizedData = logSanitizer.sanitize({ "password": "helloWorld" });
//sanitizedData = { "password": "*" }
```

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