emend

1.0.5 • Public • Published

Emend

CodeFactor

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

Readme

Keywords

Package Sidebar

Install

npm i emend

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

42.2 kB

Total Files

20

Last publish

Collaborators

  • risadams