JavaScript code minimizer (not obfuscator!)

  • Thread starter Laurent Bugnion [MVP]
  • Start date
L

Laurent Bugnion [MVP]

Hi group,

A few years ago, I translated Douglas Crockford's JsMin from C to C#,
because we wanted to use this functionality in our build process. JsMin
is a code minimizer for JavaScript. It will remove all comments, empty
lines, turn tabs into single spaces, etc... The goal is to reduce the
size of JavaScript files to the minimum necessary, without modifying the
functionality.

Additionally to reducing the script's size, JsMin also makes it more
difficult to read, however it is not an obfuscator. Objects, variables,
methods names are not modified. While such a functionality wouldn't be
very difficult to add, we believe that it is pointless to obfuscate
JavaScript files.

Note: This is a direct translation from C (procedural) to C#. I didn't
refactor the object too much, so the design is far from perfect, but it
works well.

Note 2: I just found out that Douglas translated JsMin from C to C# too,
his version is available on his site, so pick the one you prefer ;-)

http://geekswithblogs.net/lbugnion/archive/2007/02/23/107120.aspx

HTH,
Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top