Skip to content

joshgreenwell/obscure-email

Repository files navigation

Introduction

This is a module that will obfuscate emails. There are four variations as of now, listed below.

Any style not listed below, and that is passed in, will be null

Install

npm install --save obscure-email

Examples

var obf_email = require("obscure-email");

obf_email("[email protected]");

obf_email("[email protected]", "default");

Styles

styles description example output
default Shows the first 3 letters and stars the rest of the letters till the @ sign [email protected] : ema**@foo.com
end3 Stars the letters until the last 3 before the @ sign [email protected] : **[email protected]
first3rs Displays the first 3 letters with a random number of stars after, between 3 and 13 [email protected] : ema***@foo.com -- ema*****@foo.com
end3rs Displays a random number of stars first, between 3 and 13, and then the last 3 characters before the @ sign [email protected] : ***[email protected] -- *************[email protected]

Edge Case Examples

styles edge examples output
default [email protected] : *@foo.com -- [email protected] : e*@foo.com -- [email protected] : em*@foo.com
end3 [email protected] : *@foo.com -- [email protected] : *[email protected] -- [email protected] : *[email protected]
first3rs [email protected] : ***@foo.com -- [email protected] : e***@foo.com -- [email protected] : em***@foo.com
end3rs [email protected] : ***@foo.com -- [email protected] : ***[email protected] -- [email protected] : ***[email protected]

NOTE: As above, you can go to 13 stars, 3 was chosen here for simplicity.

Releases

No releases published

Packages

No packages published