Welcome to our (because it's open source) funny js minification/compression project. Now, depending on the structure of your code, this minifier can harm it. It's still a work in progress.
Before running minifyme, I recommend using jslint and fix your errors for yourself. Try https://github.com/reid/node-jslint
$ ./minifyme.py file.js
Statistics
==========
Original file size: 166 bytes
Minified file size: 90 bytes
Removed bytes: 0.45%
File file.min.js written.
The main idea is to apply a sequence of transformations to the input. These transformations are functions that receive a string (javascript code) and returns a string (javascript code) with the same behavior when interpreted (more on minification here, though, hopefully, shorter.
For a while, transformations already working are:
- Removing leading and trailing whitespaces: '\r', '\t', ' '.;
- Removing // comments;
- Removing /**/ comments;
Not yet a requirement for this project. It's just for fun!
Parse js decently.
Remove unnecessary white spaces.