A simple module to mask emails and domains
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.travis.yml
LICENSE.txt
datamask.js
package.json
readme.md
test.js

readme.md

build status

datamask.js

A simple module to mask emails, domains and even regular strings!

Setup

To set up datamask.js on your Node.js server use npm.

    npm install datamask  

Example Usage

var datamask = require('datamask');

//email(address, mask_char, user_percent, domain_percent)
console.log(datamask.email('test@example.com')); //t**t@e****le.com

console.log(datamask.email('test@example.com', '#', 45, 80)); //t#st@e#####e.com

//string(value, mask_char, percent)
console.log(datamask.string('I\'m a string!', '*', 30)); //I'm a***ring

//domain(value, mask_char, percent)
console.log(datamask.domain('example.com', '*', 50)); //ex***le.com