A powerful HTML and JavaScript obfuscator tool built with Bun runtime
npm install code-obfuscator

A powerful HTML and JavaScript obfuscator tool built with Bun runtime. Supports advanced code obfuscation, HTML minification, and external JavaScript file processing.
强大的基于 Bun 运行时的 HTML 和 JavaScript 混淆工具。支持高级代码混淆、HTML 压缩以及外部 JavaScript 文件处理。
bash
npm install -g code-obfuscator
`$3
`bash
npm install code-obfuscator
or
bun add code-obfuscator
`$3
`bash
git clone https://github.com/openapphub/code-obfuscator.git
cd code-obfuscator
bun install
`🚀 Usage
$3
`bash
code-obfuscator --input --output Examples
code-obfuscator --input index.html --output obfuscated.html
code-obfuscator --input script.js --output obfuscated.js
code-obfuscator --input ./src/app.html --output ./dist/app.html
`$3
| Option | Short | Description | Required |
|--------|-------|-------------|----------|
|
--input | -i | Input HTML or JS file path | Yes |
| --output | -o | Output file path | Yes |
| --help | -h | Show help information | No |
| --version | | Show version number | No |$3
#### 混淆 HTML 文件
`bash
code-obfuscator --input index.html --output dist/index.html
`#### 混淆 JavaScript 文件
`bash
code-obfuscator --input app.js --output dist/app.js
`#### 批量处理
`bash
Process multiple files
for file in *.html; do
code-obfuscator --input "$file" --output "dist/$file"
done
`⚙️ Obfuscation Features
The tool uses JavaScript Obfuscator with the following protection features:
$3
- ✅ 压缩 (Compaction): Remove unnecessary whitespace and comments
- ✅ 控制流扁平化 (Control Flow Flattening): Transform code structure
- ✅ 死代码注入 (Dead Code Injection): Add meaningless code to confuse analysis
- ✅ 字符串数组 (String Array): Encode strings in arrays with transformations
- ✅ 标识符重命名 (Identifier Renaming): Use hexadecimal names
- ✅ 数字表达式 (Numbers to Expressions): Convert numbers to expressions
- ✅ 字符串分割 (String Splitting): Split strings into chunks
- ✅ 自我保护 (Self-Defending): Prevent code beautification
- ✅ 控制台禁用 (Console Output Disabled): Remove console statements$3
- ✅ 内联 JavaScript 混淆: Obfuscate