open(INFILE, 'myScript.js') or die;
open(OUTFILE, '>myScript-min.js') or die;
minify(input => *INFILE, outfile => *OUTFILE);
To include a copyright comment at the top of the minified code.
minify(input => 'var x = 2;', copyright => 'BSD License');
minify(input => 'var x = 2;', stripDebug => 1);
The ``input'' parameter is mandatory. The ``output'', ``copyright'', and ``stripDebug'' parameters are optional and can be used in any combination.
The ECMAScript specifications allow for many different whitespace characters: space, horizontal tab, vertical tab, new line, carriage return, form feed, and paragraph separator. This module understands all of these as whitespace except for vertical tab and paragraph separator. These two types of whitespace are not minimized.
EXPORTExported by default: "minifiy()"
COPYRIGHT AND LICENSECopyright (C) 2007 by Peter Michaux
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.