https://github.com/pdkpavankumar/remove-sensitive-info
Npm package to remove all sensitive info from data passed
https://github.com/pdkpavankumar/remove-sensitive-info
email javascript nodejs phone-number piidata regex sensitive-data ssn
Last synced: 2 months ago
JSON representation
Npm package to remove all sensitive info from data passed
- Host: GitHub
- URL: https://github.com/pdkpavankumar/remove-sensitive-info
- Owner: pdkpavankumar
- License: mit
- Created: 2019-03-27T16:06:57.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-05T20:04:04.000Z (about 5 years ago)
- Last Synced: 2025-02-19T11:51:18.100Z (3 months ago)
- Topics: email, javascript, nodejs, phone-number, piidata, regex, sensitive-data, ssn
- Language: JavaScript
- Homepage:
- Size: 259 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# remove-sensitive-info
[](https://travis-ci.org/pdkpavankumar/remove-sensitive-info) [](https://david-dm.org/pdkpavankumar/remove-sensitive-info) [](https://david-dm.org/pdkpavankumar/remove-sensitive-info?type=dev) [](https://opensource.org/licenses/MIT)## Installation
Install `remove-sensitive-info` into to your project via `npm`:
```shell
$ npm install remove-sensitive-info --save-dev
```## Usage
new SensitiveInfo(config).parse(text) --- returns parsed text replacing all the sensitivie info (email, ssn, phone)
config: {Object}
```js
config = {
pattern: '####', // sensitive info will be replaced with this string
nodefaults: true // to remove default regex. by defaul this is false
regex: {
regexPattername1: regex1, // custom regex
regexPatternname2: [ regex21, regex22, regex33] // multiple custom regex
}
}
```
## example1:```js
import SensitiveInfo from 'remove-sensitive-info'initialization(){
sensitiveinfo = new SensitiveInfo(config);
}method(){
console.log(sensitiveinfo.parse('some awesome text with email [email protected]'));
}
```
output:
```sh
some awesome text with email *****
```## example2:
```js
import SensitiveInfo from 'remove-sensitive-info'initialization(){
sensitiveinfo = new SensitiveInfo({
pattern: '####',
nodefaults: true,
regex: {
regex1: 'hello'
}
});
}method(){
console.log(sensitiveinfo.parse(['hello [email protected]', 'hello [email protected]']));
}
```
output:
```sh
[ "#### [email protected]", "#### [email protected]" ]
```# License
MIT © P D K Pavan Kumar