🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

email-obfuscate

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email-obfuscate

Guard email addresses from being simply scraped by bots.

0.0.6
latest
Source
npm
Version published
Weekly downloads
3
-70%
Maintainers
1
Weekly downloads
 
Created
Source

Email Obfuscate Build Status

Example

Guard email addresses from being simply scraped by bots.

Demo

http://dunckr.github.io/email-obfuscate/example/

Overview

Email addresses are harvested from websites using web scrapers.

There are many strategies that can be employed to mitigate scrapers: 1, 2, 3, 4. However, it must be noted that preventing scraping is an arms-race.

This library's aim to prevent searching for mailto links or using email address regexes.

It does this by constructing an email address from an object then drawing the text as an image using the canvas.

For older browsers without a canvas (IE8) we append an element using the alternate text.

Installation

npm install email-obfuscate --save

Usage

import EmailObfuscate from 'email-obfuscate';

var el = document.getElementById('email');

EmailObfuscate(el, {
  // Email construct: name@domain.tld
  name: 'test',
  domain: 'example',
  tld: 'com',
  // Alternate Text
  altText: 'Email'
});

API

EmailObfuscate(el, [options])

el

Type: HTMLElement

The element to replace with EmailObfuscate.

options

name

Type: string
Default: test

The name portion of the email address to use (name@email.com).

domain

Type: string
Default: example

The domain name portion of the email address to use (name@email.com).

tld

Type: string
Default: com

The top-level domain portion of the email address to use (name@email.com).

altText

Type: string
Default: Email

The alternate text to use to represent the email address.

Dev

npm run start

Test

npm run test

Build

npm run build

License

MIT © Duncan Beaton

Keywords

email

FAQs

Package last updated on 09 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts