The module is a non-blocking wrapper around JavaScript::Minifier, which provides interface to strip useless spaces from JavaScript code. The wrapper also provides additional functionality to fetch JavaScript from URI.

Optional. One of the methods to give input. Takes a filename as an argument. The file will be opened and the filehandle will be given to minify() function of JavaScript::Minifier to serve as JavaScript code to "minify".

Optional. When specified, the "minified" JavaScript code will be written to the file, filename of which you specify in outfile argument. Note: file will be created if does not exist and completely destroyed without a warning if it does exist. If not specified the minified JavaScript code will be passed to the output event handler (see below).

The event handler set up to handle the event which you've specified in the event argument to minify() method/event will receive input in the $_[ARG0] in a form of a hashref. The possible keys/value of that hashref are as follows:

If an error occurred, the error key will be present and its value will be description of an error. The error could be errors during opening input or output files as well as network errors when uri argument was given to minify event/method.