1.0.2 • Published 5 years ago

log-sanitizer v1.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

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');
  1. Initialize object with array of fields to be sanitized
const logSanitizer = new Sanitize(['password'])
  1. 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": "*" }
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago