views:

4008

answers:

1

Online javascript minify tools basically strip out comments and whitespace.

Is there a tool that can reverse this? Taking what is usually a single line of code:

function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}}

and auto-formatting it so you can begin reverse-engineering it?

function(){
    var K=o.timers;
    for(var J=0;J<K.length;J++){
        if(!K[J]()){
            K.splice(J--,1);
        }
    }
    if(!K.length){
        clearInterval(n);
        n=g;
    }
 }
+14  A: 

Got it! JSBeautifier does exactly this, and you even have options for the auto-formatting.

Jenko
+1, 37 seconds faster. :) Of course, it's your question, so...
altCognito
Yea I just found it by following the "unminify" tag.
Jenko
stackoverflow-then-google instead of google-then-stackoverflow? :))))
dfa
I did the google for "javascript formatter online"
altCognito