Popularity
6.2
Growing
Activity
4.6
-
746
38
198

Description

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 javascript on the fly (although caching the results is suggested for performance reasons). Unlike many other products this is not a port into php but a native application, resulting in better performance.

Code Quality Rank: L4
Programming language: PHP
License: BSD 3-clause "New" or "Revised" License
Tags: Asset Management     JavaScript     Minifier    
Latest version: v1.3.3

JShrink alternatives and similar libraries

Based on the "Asset Management" category.
Alternatively, view JShrink alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of JShrink or a related project?

Add another 'Asset Management' Library

README

JShrink Build Status

License Latest Stable Version Coverage Status Total Downloads

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 javascript on the fly (although caching the results is suggested for performance reasons). Unlike many other products this is not a port into php but a native application, resulting in better performance.

Usage

Minifying your code is simple call to a static function-

<?php
include('vendor/autoload.php');

// Basic (default) usage.
$minifiedCode = \JShrink\Minifier::minify($js);

// Disable YUI style comment preservation.
$minifiedCode = \JShrink\Minifier::minify($js, array('flaggedComments' => false));

Results

  • Raw - 586,990
  • Gzip - 151,301
  • JShrink - 371,982
  • JShrink and Gzip - 93,507

Installing

Composer

Installing JShrink can be done through a variety of methods, although Composer is recommended.

"require": {
  "tedivm/jshrink": "~1.0"
}

Github

Releases of JShrink are available on Github.

License

JShrink is licensed under the BSD License. See the LICENSE file for details.

In the spirit of open source, use of this library for evil is discouraged but not prohibited.

Reporting Security and Vulnerability Issues

This project utilizes the Tidelift Security Reporting System for security and vulnerability reporting.

Support

Issues can be opened directly in Github for issues that aren't related to security.

Professionally supported JShrink is now available with Tidelift.


*Note that all licence references and agreements mentioned in the JShrink README section above are relevant to that project's source code only.