Privacy Holder
Hide some sensitive data with character '*'
Features
- Support hide common user data like: email, phone number, id card etc.
- Support Custom rules (fragment method) to hide sensitive data.
- 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
Top comments (4)
Is your github repo private? I have got a 404 not found error when I click on your link.
github.com/ihavecoke/privacy-holder
Thks sergey
Sorry i post wrong url for post, now i have fixed it. :)