log-sanitizer

1.0.2 • Public • Published

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": "*" }

Readme

Keywords

none

Package Sidebar

Install

npm i log-sanitizer

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

4.1 kB

Total Files

6

Last publish

Collaborators

  • dliu74