Socket
Book a DemoInstallSign in
Socket

posthtml-obfuscate

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthtml-obfuscate

PostHTML plugin that'll obfuscate emails etc...

latest
Source
npmnpm
Version
0.1.5
Version published
Maintainers
1
Created
Source

PostHTML Obfuscate

NPM version Travis Codecov

Obfuscates emails to make it harder for bots to recognize.

Install

npm i posthtml-obfuscate -D

Output

<!-- Before -->
<a href="mailto:sam@smith.com">
	sam@smith.com
</a>

<!-- After -->
<a href="mailto:&#115;&#97;&#109;&#64;&#115;&#109;&#105;&#116;&#104;&#46;&#99;&#111;&#109;">
	&#115;&#97;&#109;&#64;&#115;&#109;&#105;&#116;&#104;&#46;&#99;&#111;&#109;
</a>

Usage

const posthtml = require('posthtml');
const phObfuscate= require('posthtml-obfuscate');

const options = {
	includeMailto: false
};

posthtml([phObfuscate(options)])
	.process(myHtml)
	.then(result => {
		console.log(result.html); // The output
	});

Options

  • includeMailto: Boolean - Includes the mailto: prefix in the obfuscation. (Default: false)

Keywords

posthtml

FAQs

Package last updated on 20 Sep 2016

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