privacy-holder
v0.0.7
Published
Hide some sensitive data with the character '*'
Downloads
16
Maintainers
Readme
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("[email protected]") // 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