joe92 Posted October 17, 2011 Share Posted October 17, 2011 (I don't know whether this should be in this forum or an installation forum? Please move if required.) I am coming close to making my site go live and it has always been on the back of my mind to minimise and obfuscate the javascript code before I launched whiles keeping a raw copy in my sandbox site. I haven't yet come to trying the obfuscating of the code (and might not do as the minimisers already make it hard as hell to read plus to do some obfuscating already). I have found several reviews on all of the different minimisers and the two top ones that people talk about are the YUI compressor and Uglify, with the latter being better in terms of compression rate / speed but the former also compresses css code. However, I cannot find a single useful guide anywhere on how to install either these programs onto my server. For the Uglify version there is a handy online website that has it implemented for people to use, but I just don't feel comfortable sending my code to another persons server and back not knowing exactly what's going on (although I did test it on one of my smaller files and got 49% compression). The Uglify program does give an installation guide, but it uses commands such as 'git clone git://github.com/mishoo/UglifyJS.git'. I am using PuTTY as my ssh client and it does not recognise this. I tried changing it to 'wget https://github.com/mishoo/UglifyJS/zipball/master' and this did not work either. So my question is. Has anyone had any experience with either of these programs? If so, could you tell me how to install it to my server? Or is there a program I can download to my computer that can minimise the script without having to go through putty? I also tried the online javascriptcompressor.com (aka packer) but this just threw up error after error on the JSLint validator, even after I double checked to make sure there was a ';' at the end of every line, and the script would not work on my website. I would be better off just manually removing the white space than using that. Thank you for any help Joe Quote Link to comment https://forums.phpfreaks.com/topic/249254-obfuscate-or-minimise-programs/ Share on other sites More sharing options...
trq Posted October 17, 2011 Share Posted October 17, 2011 Looking at the Uglify src it is written in node.js. You would need to install this before you could use it. Quote Link to comment https://forums.phpfreaks.com/topic/249254-obfuscate-or-minimise-programs/#findComment-1279916 Share on other sites More sharing options...
joe92 Posted October 20, 2011 Author Share Posted October 20, 2011 Have you had any experience with node.js? Is it worth installing? Quote Link to comment https://forums.phpfreaks.com/topic/249254-obfuscate-or-minimise-programs/#findComment-1280818 Share on other sites More sharing options...
Adam Posted October 20, 2011 Share Posted October 20, 2011 The Uglify program does give an installation guide, but it uses commands such as 'git clone git://github.com/mishoo/UglifyJS.git'. I am using PuTTY as my ssh client and it does not recognise this. I tried changing it to 'wget https://github.com/mishoo/UglifyJS/zipball/master' and this did not work either. `git clone` is a Git command. You need to install Git and then have a directory where you can clone the remote repository to. Quote Link to comment https://forums.phpfreaks.com/topic/249254-obfuscate-or-minimise-programs/#findComment-1280872 Share on other sites More sharing options...
trq Posted October 20, 2011 Share Posted October 20, 2011 You can also download repos as a zip directly from Github if your not planning on working on the project itself. Quote Link to comment https://forums.phpfreaks.com/topic/249254-obfuscate-or-minimise-programs/#findComment-1280945 Share on other sites More sharing options...
joe92 Posted October 21, 2011 Author Share Posted October 21, 2011 I think I'll refrain from installing node.js or git for now. It sounds interesting and I will most probably test it out in the future but not on a server thats just about to go live haha. Thanks for the info. I'll mark the topic as solved. Quote Link to comment https://forums.phpfreaks.com/topic/249254-obfuscate-or-minimise-programs/#findComment-1281208 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.