]> git.wh0rd.org - tt-rss.git/blame - vendor/JShrink/README.md
strip_harmful_tags: remove data- attributes
[tt-rss.git] / vendor / JShrink / README.md
CommitLineData
22f5fdf8 1# JShrink [![Build Status](https://travis-ci.org/tedious/JShrink.svg?branch=master)](https://travis-ci.org/tedivm/JShrink)
107997e6 2
22f5fdf8
AK
3[![License](http://img.shields.io/packagist/l/tedivm/JShrink.svg)](https://github.com/tedivm/JShrink/blob/master/LICENSE)
4[![Latest Stable Version](http://img.shields.io/github/release/tedious/JShrink.svg)](https://packagist.org/packages/tedivm/JShrink)
5[![Coverage Status](https://coveralls.io/repos/tedious/JShrink/badge.png?branch=master)](https://coveralls.io/r/tedivm/JShrink?branch=master)
6[![Total Downloads](http://img.shields.io/packagist/dt/tedivm/jshrink.svg)](https://packagist.org/packages/tedivm/JShrink)
7
8
9JShrink is a php class that minifies javascript so that it can be delivered to the client quicker. This code can be used
10by any product looking to minify their javascript on the fly (although caching the results is suggested for performance
11reasons). Unlike many other products this is not a port into php but a native application, resulting in better
12performance.
13
14
15## Usage
107997e6
AD
16
17Minifying your code is simple call to a static function-
18
22f5fdf8 19```php
107997e6 20<?php
22f5fdf8
AK
21include('vendor/autoload.php');
22
107997e6 23// Basic (default) usage.
22f5fdf8 24$minifiedCode = \JShrink\Minifier::minify($js);
107997e6
AD
25
26// Disable YUI style comment preservation.
22f5fdf8
AK
27$minifiedCode = \JShrink\Minifier::minify($js, array('flaggedComments' => false));
28```
107997e6 29
22f5fdf8
AK
30
31## Results
107997e6
AD
32
33* Raw - 586,990
34* Gzip - 151,301
35* JShrink - 371,982
36* JShrink and Gzip - 93,507
22f5fdf8
AK
37
38
39## Installing
40
41### Composer
42
43Installing JShrink can be done through a variety of methods, although Composer is
44recommended.
45
46```yaml
47"require": {
48 "tedivm/jshrink": "~1.0"
49}
50```
51
52### Github
53
54Releases of JShrink are available on [Github](https://github.com/tedious/JShrink/releases).
55
56
57## License
58
59JShrink is licensed under the BSD License. See the LICENSE file for details.
60
61In the spirit of open source, use of this library for evil is discouraged but not prohibited.