DEV Community

mixbo
mixbo

Posted on • Edited on

2 1

You can hide sensitive data with '*'

Privacy Holder

Hide some sensitive data with character '*'

Features

  1. Support hide common user data like: email, phone number, id card etc.
  2. Support Custom rules (fragment method) to hide sensitive data.
  3. Test Coverage 100%

Install

yarn add privacy-holder
Enter fullscreen mode Exit fullscreen mode

or

npm install privacy-holder
Enter fullscreen mode Exit fullscreen mode

PS: Do not install version 0.0.4, 0.0.5 these versions are break

Usage

 const privacy = require('privacy-holder')
Enter fullscreen mode Exit fullscreen mode

Then

 privacy.email("ihavecoke@163.com") // ih*******@163.com
 privacy.name("ihavecoke") // *
 privacy.name("i havecoke") // *havecoke
 privacy.idCard("510122199102132018") // 510***19******2018
 privacy.phoneNumber("13800000000") // 138****0000
 privacy.all('all-will-be-*') // *************
Enter fullscreen mode Exit fullscreen mode

Also, you can custom rules like this

 privacy.fragment('abcdefgi','####',2,6) // ab####i
Enter fullscreen mode Exit fullscreen mode

more privacy-holder

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (4)

Collapse
 
vga profile image
Victor Gallet

Is your github repo private? I have got a 404 not found error when I click on your link.

Collapse
 
hottabxp profile image
Sergey
Collapse
 
ihavecoke profile image
mixbo

Thks sergey

Collapse
 
ihavecoke profile image
mixbo

Sorry i post wrong url for post, now i have fixed it. :)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more