javascript/jquery: code packer/obfuscator [duplicate]
-
26-09-2019 - |
Question
Possible Duplicates:
How can I obfuscate JavaScript?
What do you use to minimize and compress JavaScript libraries?
hi all,
2 questions:
i'd like to compress my code, anyone knows which compressor the guys from jquery are using? or is there any free script? (i'd like to use the compressor using an automated asp-script, so no standalone software)
is there a good code obfuscator which makes it harder for code stealers? best would be a combination of packer+obfuscator :)
thx
Solution
There is a really great compressor from Google called closure compiler:
http://closure-compiler.appspot.com/
There are three different degrees of compilation you can use.
WHITESPACE_ONLY
SIMPLE_OPTIMIZATIONS
ADVANCED_OPTIMIZATIONS
It also lets you compile your code programatically using an external API.
OTHER TIPS
This is what I use: http://developer.yahoo.com/yui/compressor/
My advice is to not bother with obfuscation, if someone really wants to steal it they can.
Compressor:
http://javascriptcompressor.com/
Beautifier:
jsbeautifier.org
No there is no way to stop js from being stolen, but you can make it really really hard to understand. Obfuscate, Use function closures