shrink 1.0

BSD License

shrink 1.0

shrink is a command for concatenating and compressing css stylesheets and javascript files making them smaller. Shrinking (or minifying) these files reduces the number of request that are made after a page load and also the size of these requests.

This command depends on YUI Compressor to do the work, and can be run with Python 2.5 and above.

INI style config files are used to know which files will be minified and also to know which ones will be merged before minimization.

To display script information and options run:

 shrink -h

Minimize css and js files

To minimize all files, run:

 shrink -f example_shrink.cfg all

This will use yuicompressor.jar and the example_shrink.cfg file in current directory to compress all files.

In case that minimzation is not desired for all files, is also possible to minimize individual files, or a group of files, by using the name(s) of each section instead of all as argument.

To list available sections, run:

shrink -f example_shrink.cfg -l

Config file format

Config file is an INI file with a section defined for each individual file that can be generated.

For minification of a single file a section would be written as:

[sample-single-file-js]
source_directory = %(base_dir)s/js
destination_file = sample-file.min.js
source_files = sample-file.js


Section options:

- source_directory value will point to the directory where file(s) listed in source_files are located.
- source_files value can be a single file name, or a list of file names. When a list of names is given, each file in list is concatenated (from top to down) into a single file before compression.
- destination_directory When this value is present it is used as output directory for the minified file. By default minified file is generated in source directory.
- destination_file value is the name for the minified file.
- hash when true include destination file in shrink hash. See Shrink hash file.

Many files can be specified to be concatenated into a single file that will be named with the value given in destination_file, by writing a section like:

[sample-multiple-file-css]
source_directory = %(base_dir)s/css
destination_file = sample-multiple-file.min.css
source_files =
 sample-file1.css
 sample-file2.css
 sample-file3.css


Section groups

Instead of running script with sample-single-file-js and sample-multiple-file-css as arguments is possible to define a group like:

[sample-group]
group =
 sample-single-file-js
 sample-multiple-file-css


And then run minifier script with sample-group as parameter.

Shrink hash file

After minification Shrink can create a file containing a SHA1 hash. The file is created when at least one section in config file has hash = true. Hash is created using the contents of all destination files in these sections.

This is useful to know when some files changed, and to reload static css and javascript files without using a timestamp or version number. Sometime can be desirable to reload modified static files without increasing application version. In these cases the hash can be used as request parameter instead of version number.


Product's homepage

Requirements:

· Python

Download and use it now: shrink 1.0 free download

Add a review

Tell us your experience with shrink 1.0

Related programsOur Recommendations

netCDF4 1.0

netCDF version 4 has many features not found in earlier versions of the library and is implemented

Download

Army Speeder 1.0

Those cold blooded terrorists cannot stand even a single chance of escaping from you! No sir, for

Download

GNOME-Mud 0.11.2

GNOME-Mud project consists of a MUD client for the GNOME platform.GNOME-Mud (formerly AMCL) is a

Download

collective.collage.windowz 1.0

collective.collage.windowz is a collage add-on that allows displaying iframe content.Product's

Download

GNU Teseq 1.0.0

GNU Teseq is an application for analyzing files that contain control characters and terminal

Download

MediaWiki Wiki JumpBox 1.1.6

MediaWiki is a powerful wiki engine originally developed for the Wikipedia project and now deployed

Download

openTCS 2.5.1

openTCS is an open source graphical software written in the Java programming language and designed

Download

SearchMonkey 0.8.1

SearchMonkey project bridges the gap between Beagle (simple interface, large search net) and

Download

CGIProxy 2.1.6

CGIProxy is a free anonymizing, filter-bypassing, HTTP/FTP proxy CGI script.CGIProxy can run under

Download

Mickey Hex Editor 0.1.13

Mickey is a hex/ascii file viewer and editor that runs on all major operating systems thanks to

Download

Thumbnail of shrink 1.0

Rating:

5 stars

Price: FREE

Publisher/Developer: Jeronimo Jose Albi

Release Date: Jul 13, 2012

View Program Details

Top Downloadslast week