ObfuscateJS 0.3.2 review

Download
by rbytes.net on

ObfuscateJS is a command line JavaScript obfuscator

License: Freeware
File size: 21K
Developer: Michiel van Vlaardingen
0 stars award from rbytes.net

ObfuscateJS is a command line JavaScript obfuscator. ObfuscateJS strips comments and unneeded whitespace, shortens local variable names, and shortens variable names with a given prefix (e.g. "_"). ObfuscateJS can be used for libraries because it preserves the API.

Reduce the size of Javascript files

Keeping files small is important for websites. With the hype around AJAX technology, the use of javascript increases and reducing the size of Javascript files becomes important. Besides rendering files unusable an Obfuscator has the effect of greatly reducing the filesize.
In need of a good Javascript Obfuscator during the development of the Consyn Framework, 2Vi created a free obfuscator in Java. This project is now named ObfuscateJS.

The obfuscator currently removes whitespace and comments. It renames variablenames with a local scope to a shorter version, And as an advanced option it renames all variables with a certain prefix to a shorter name. In the near future the tool will be extended with even more options to shorten variable names.

An important aspect of ObfuscateJS is that it preserves the API of your scripts. This is important when creating libraries such as the Consyn Framework.

Usage

After downloading, in order to apply ObfuscateJS to a file, the following command must be used:

java -jar consyntools.jar Obfuscator {src} {dest} {prefix}

{src} : The sourcefile
{dest} : The output file
{prefix} : The prefix of variables, which can be renamed without problems
In order to explain the 'prefix' option, let's look at the following code:
function _debug(){...}
...
_debug();
Now if we choose '_' as the prefix, this code will be rewritten as:
function _a(){...}
...
_a();
This prefix can be ommitted, in this case only local variables are rewritten.

What's New in This Release:
This version fixes a bug related to reserved keywords which were sometimes accidentaly used as new variable names.
Furthermore, a simple API has been added to call ObfuscateJS directly from a Java program.

ObfuscateJS 0.3.2 search tags