JShrink

JavaScript Minifier built in PHP
Download

JShrink Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • tedivm
  • Publisher web site:
  • http://tedivm.com

JShrink Tags


JShrink Description

JavaScript Minifier built in PHP JShrink is a PHP class that minifies JavaScript so that it can be delivered to the client quicker. This code can be used by any product looking to minify their js on the fly (although caching the results is suggested). Unlike many other products this is not a port into php but a native application, resulting in better performance.This project came about from the Mortar project, which itself combines and minifies all of its javascript into a single file to be delivered to users. Using that system we can provide some real numbers. * Raw - 586,990 * Gzip - 151,301 * JShrink - 371,982 * JShrink and Gzip - 93,507 Usage:Minifying your code is simple call to a static function-// Basic (default) usage.$minifiedCode = JShrink::minify($js);// Disable YUI style comment preservation.$minifiedCode = JShrink::minify($js, array('flaggedComments' => false));You should cache the results as the minification process can be intensive for longer files. I expect most people would want to let their own caching systems handle this, but if there's demand it can certainly be added. Requirements: · PHP What's New in This Release: · Conditional Comment Support · Comment Preservation for comments beginning with /*! · Corrected a bug that occurred when a regular expression began with a string delimiter


JShrink Related Software