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

html-obfuscator

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-obfuscator

Extremely simple HTML obfuscator.

2.0.0
latest
Source
npm
Version published
Weekly downloads
317
-14.32%
Maintainers
1
Weekly downloads
 
Created
Source

html-obfuscator

Extremely simple HTML obfuscator.

Inspired by snapbuilder.com.

[!WARNING] Unless you are working with just plain HTML files, you probably want to use something more advanced instead.

Example

demo.html

<div>
    <h1>Hello World!</h1>
</div>
<style>
    div {
        display: flex;
        justify-content: center;
    }
</style>

Read demo.html file and obfuscate it.

const { obfuscate } = require('html-obfuscator');
const fs = require('fs');
const source = fs.readFileSync('demo.html');

const out = obfuscate(source);

Result:

<script>document.write(unescape('%3C%64%69%76%3E%0A%20%20%20%20%3C%68%31%3E%48%65%6C%6C%6F%20%57%6F%72%6C%64%21%3C%2F%68%31%3E%0A%3C%2F%64%69%76%3E%0A%3C%73%74%79%6C%65%3E%0A%20%20%20%20%64%69%76%20%7B%0A%20%20%20%20%20%20%20%20%64%69%73%70%6C%61%79%3A%20%66%6C%65%78%3B%0A%20%20%20%20%20%20%20%20%6A%75%73%74%69%66%79%2D%63%6F%6E%74%65%6E%74%3A%20%63%65%6E%74%65%72%3B%0A%20%20%20%20%7D%0A%3C%2F%73%74%79%6C%65%3E'))</script>

CLI Usage

html-obfuscator <filepath|text>

If the argument is a path and exists, it will be used, otherwise the arguments themselves will be treated as HTML and obfuscated.

License

MIT

Keywords

html

FAQs

Package last updated on 23 Mar 2024

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