Skip to main content

See ‘src/zif/jsmin/README.txt’ for more information.

Releases

0.1 (2007/04/13)

Initial release.

Detailed Documentation

zif.jsmin

This is a wsgi middleware application intended for use with paste.deploy, zope.paste, and zope3.

It serves as a wsgi filter to “minimize” javascript for a zope3 application.

This can be slow. You probably do not want to run this in production unless you have (small) dynamically-generated scripts and css. But it can be useful for generating minimized javascript or css for resources. Those larger files can then be excluded from on-the-fly minimization.

Dependencies

For zope3, jsmin requires Sidnei da Silva’s zope.paste.

zope.paste is available at http://svn.zope.org/zope.paste/trunk/

cd [path.to.zope3.src.directory]/zope
svn co http://svn.zope.org/zope.paste/trunk/ paste

Instructions for zope.paste are at http://awkly.org/

zope.paste requires paste.deploy. paste.deploy can be obtained from the cheese shop. Presuming you have setuptools installed,

sudo easy_install.py PasteDeploy

This (zif.jsmin) package can be unzipped and installed anywhere on the Python path.

Setup

Follow Sidnei’s instructions for setting up zope.paste. It involves putting the usual zope.paste-configure.zcml file in [zope3 instance]/etc/site-packages. There is also a parameter to change in [zope3 instance]/etc/zope.conf. The new twist is a paste.ini file in [zope3 instance]/etc

An example paste.ini file looks like:

[pipeline:Paste.Main]
pipeline = gzipper jsmin main

[app:main]
paste.app_factory = zope.paste.application:zope_publisher_app_factory

[filter:gzipper]
paste.filter_factory=gzipper.gzipper:filter_factory
compress_level=6
nocompress=jp gz zip
tempfile=0

[filter:jsmin]
paste.filter_factory=jsmin.jsmin:filter_factory
compress_level=safe
compress_types=js css
exclude=MochiKit

Configuration

The paste.ini file above shows examples of the configuration options for jsmin.

  • compress_level is the degree of minimization desired. “safe” is often good enough; it mainly removes spaces. “full” will additionally munge variable names in javascript to make a more compact (and even less readable) module. Default is “safe”

  • compress_types determines whether to compress javascript or css or both. For both, use “css js”, which is the default. For just one, specify “css” or “js”

  • exclude is for excluding large files that presumably are already compressed. You may exclude on several matches; just put a space between them. The module looks for consecutive characters in the url, and is case-sensitive. “K” would exclude MochiKit.js or any file with “K” in its name. “big_scripts” would exclude any file in the big_scripts url/folder.

Download

Release files for zif.jsmin 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zif.jsmin 0.2
File Size Uploaded
zif.jsmin-0.2.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zif.jsmin 0.2
File Interpreter ABI Platform
zif.jsmin-0.2-py2.4.egg Legacy Egg format - - Details

Total release size: 30.4 kB

Release files / zif.jsmin-0.2.tar.gz

Download URL zif.jsmin-0.2.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5928b62371bf33081b3d7f8f44d8cb4f18049a98f0e753fe3337b22af39b69e5
BLAKE2b-256 checksum
How to use checksums
50c1c698e94c2eab314e495f426cf74b4999fb31eb633e4a98df07b73495e44e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / zif.jsmin-0.2-py2.4.egg

Download URL zif.jsmin-0.2-py2.4.egg
Size 19.6 kB
Tags Egg
SHA-256 checksum
How to use checksums
c84c08dddc5c9929659d4d379fd6682b23246f96fb0f56db7c52b695726626c7
BLAKE2b-256 checksum
How to use checksums
9502a49fd4929920ece600b7602ec0b9bf6eaf246d8d37ba7b9ead2398d00606
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page