Documentation

JavaScript Obfuscator docs

Reference guides for command-line usage, protection options, cross-file workflows, and the desktop app.

Inside The Docs

Practical guides, not placeholder pages.

How-to guides Start with command-line usage, then move into feature-specific references.
Advanced protection Browse cross-file obfuscation topics like Replace Globals and Protect Members.

Code Transposition

  • ReorderCode
  • Basic

Code Transposition moves global code into a generated wrapper so that functions and statements no longer appear in the same straightforward structure as the original source.

How it works

The option collects global statements and functions into a generated scope, then rewrites references so the output relies more heavily on local indirection. That makes the final file harder to follow because the top-level logic is no longer exposed in a direct, readable order.

Example

Without Code Transposition:

function logit() {
}

function mylogic() {
    logit();
}

With Code Transposition enabled:

var logit, mylogic;
(function () {
    function a() {
    }
    function b() {
        a();
    }
    logit = a;
    mylogic = b;
})();
Compatibility note: test code that depends on replacing function declarations at runtime. In those cases, assigning a function to a variable can be more predictable than relying on a top-level declaration.