Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.js-confuser.com/llms.txt

Use this file to discover all available pages before exploring further.

  • Option name: "target"
  • Option values: "browser"/"node"

Usage Example

The provided code example will obfuscate the file input.js and write the output to a file named output.js.
import JSConfuser from "js-confuser";
import {readFileSync, writeFileSync} from "fs";

// Read input code
const sourceCode = readFileSync("input.js", "utf8");
const options = {
  target: 'node',
  compact: true,
};

JSConfuser.obfuscate(sourceCode, options).then((result)=>{
  // Write output code
  writeFileSync("output.js", result.code);
}).catch(err=>{
  // Error occurred
  console.error(err);  
});