
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
email-obfuscate
Advanced tools
Guard email addresses from being simply scraped by bots.
http://dunckr.github.io/email-obfuscate/example/
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.
npm install email-obfuscate --save
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'
});
Type: HTMLElement
The element to replace with EmailObfuscate.
Type: string
Default: test
The name portion of the email address to use (name@email.com).
Type: string
Default: example
The domain name portion of the email address to use (name@email.com).
Type: string
Default: com
The top-level domain portion of the email address to use (name@email.com).
Type: string
Default: Email
The alternate text to use to represent the email address.
npm run start
npm run test
npm run build
MIT © Duncan Beaton
FAQs
Guard email addresses from being simply scraped by bots.
The npm package email-obfuscate receives a total of 3 weekly downloads. As such, email-obfuscate popularity was classified as not popular.
We found that email-obfuscate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.