open(my $in, myScript.js) or die;
open(my $out, >, myScript-min.js) or die;
minify(input => $in, outfile => $out);
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.