确保你的系统已经安装了 Node.js。然后使用 npm 安装 JavaScript Obfuscator

npm install -g javascript-obfuscator

安装完成后,可以通过命令行工具 javascript-obfuscator 使用它。

可以使用以下命令,进行js代码混淆和加密。注意,如果你的js文件名称不叫做input.js,需要将下面命令的input.js改成你的js文件名称。

javascript-obfuscator input.js --output output.js --compact true  --string-array true --string-array-encoding base64