emend
v1.0.5
Published
A lightweight JS-based library to inline redact e-mail addresses to protect against against scraping.
Downloads
4
Readme
Emend
A simple library that will allow you to replace an e-mail address with an encoded version of the address.
Install
npm install emend
Usage
include the library in your project:
<head>
<script src="emend.js"></script>
</head>
and initialize it in your code (just before the end body
tag):
<script>
emend.init('YOUR SALT VALUE');
</script>
Option Defaults
/**
* @param {String} explicitPrefix - The prefix to use for explicit emendations.
* @param {String} salt - The salt to use for emendations.
* @param {Boolean} explicitOnly - Whether to only emend explicit elements.
* @param {Number} domRemoveDelay - The delay in milliseconds to remove the emendation from the DOM.
* @param {Number} sendClickDelay - The delay in milliseconds to send a click event to the emendation.
*/
{
explicitPrefix: '@',
salt: '',
explicitOnly: false,
domRemoveDelay: 1200,
sendClickDelay: 500
};
Contribute
If you think this could be better, please open an issue!
Please note that all interactions in this organization fall under our Code of Conduct.
License
MIT © 1996+ Ris Adams