0.0.1 • Published 5 years ago

word-masking-helper v0.0.1

Weekly downloads
64
License
MIT
Repository
github
Last release
5 years ago

Word-Masking-Helper

A simple javascript helper for masking email and phone number

Installation

npm install word-masking-helper

Examples

import emailPhoneMasking, { maskingEmail, maskingPhone } from 'word-masking-helper'

const description = `
Hi, my name Devin Ekadeni.
You can contact me by email:
- devinekadeni@example.com
- ekadeni.devin@example.co.id

Or you can contact me by phone:
- 08123456789
- +628123456789
- (021) - 5312345

Or you could call my manager at 09871234567 or vina@example.com
`

const maskedDescription = emailPhoneMasking(description)

console.log(maskedDescription)

/* Console Output
Hi, my name Devin Ekadeni.
You can contact me by email:
- d**********i@e*******com
- e***********n@e*********.id

Or you can contact me by phone:
- 081******89
- +62********89
- (02**********45

Or you could call my manager at 098*******7 or v**a@e*******com
*/

// You can also use `maskingEmail` or `maskingPhone` only

you can try the sandbox here