1.2.0 • Published 6 years ago

obfooscator v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Obfooscator

The purpose of this module is to obfuscate email addresses that you would have in HTML pages, to deter those email addresses from being harvested by page scrapers.

Installation

npm install obfooscator

Usage

Front-end:

import {obfooscator} from 'obfooscator';

let email = 'sample@example.com';

console.log(obfooscator(email)); //sa\u006Dpl\u0065@\u0065xa\u006Dpl\u0065.co\u006D (may vary, obfuscation is randomized)

Back-end

const obfooscator = require('obfooscator');

let email = 'sample@example.com';

console.log(obfooscator(email)); //sa\u006Dpl\u0065@\u0065xa\u006Dpl\u0065.co\u006D (may vary, again)

Options

You can pass an optional second param to the function in order to change from getting unicode to getting HTML entities. There is a JSX gotcha where it won't (nicely) process HTML entities without the use of hackery, so the default is the Unicode characters. However, if you are using this on the back-end, and the resulting entities don't need to get processed by JSX, then pass false as the second param.

Example:

const obfooscator = require('obfooscator');

let email = 'sample@example.com';

console.log(obfooscator(email, false)); 

If you have any questions, please contact me at don (at) donburks (dot) com.

1.2.0

6 years ago

1.1.4

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago