loading...

You can hide sensitive data with '*'

ihavecoke profile image mixbo Updated on ・1 min read

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

or

npm install privacy-holder

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

Usage

 const privacy = require('privacy-holder')

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-*') // *************

Also, you can custom rules like this

 privacy.fragment('abcdefgi','####',2,6) // ab####i

more privacy-holder

Posted on May 24 by:

ihavecoke profile

mixbo

@ihavecoke

Web developer in Longbridge

Discussion

markdown guide
 

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

 

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