Javascript::Closure

Compress your JavaScript code using Google online service of Closure Compiler
Download

Javascript::Closure Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Shirirules
  • Publisher web site:
  • http://search.cpan.org/~shiriru/

Javascript::Closure Tags


Javascript::Closure Description

Compress your JavaScript code using Google online service of Closure Compiler Javascript::Closure is a Perl package that allows you to compress your javascript code by using the online service of Closure Compiler offered by Google via a REST API.The Closure compiler offers 3 different level of compression and tools to analyze the code.You can therefore get errors, warnings about the code and some statistics about the compression.The Closure compiler offers also some annotations to be used in your code in order to offer optimum compression.This can come in handy once a project is finished to merge all the files, pass it through the ADVANCED_OPTIMIZATIONS algorithm to get the most out of it.SYNOPSIS #nothing is imported by default use Javascript::Closure qw(minify :CONSTANTS); #open a file open (FILE,'< ','jscript.js') or die $!; my @lines = < FILE >; close FILE; #compress the code. most of the time it will be all you need! my $compressed = minify(input=>join('',@lines)); #output the result in another file open FILE,'>','closure-jscript.js' or die $!; print FILE $compressed; close FILE; #further settings: my $compressed = minify(input => , output_format => XML, output_info => , compilation_level=> SIMPLE_OPTIMIZATIONS, warning_level => VERBOSE ); Requirements: · Perl


Javascript::Closure Related Software