Skip to main content

JS Min script that provides cmd line and python processors

Project description

lpjsmin for minifying js files

We need to handle several minification goals within the Launchpad codebase. This helps to create a single lib to help handle all of the cases and allow it to be flexibly used in more projects.

Usage

cmd line

You can pass the cmd line lpjsmin either a filename or a directory and it’ll process the file(s) adding a $fname-min.js next to the original file. This is used for things like minifying files in the combo directory. You can just let it know the root of the combo directory and it’ll minify all files it finds in there.

$ lpjsmin static/js/
$ lpjsmin static/js/myapp.js

python usage

You can import the module and minify in your own build scripts either via just filename and directory.

import lpjsmin
lpjsmin.minify('static/js')
lpjsmin.minify('static/js/myapp.js')

If you need to be able to customize the name or location of the minified files, wrap the lpjsmin script in your own build script and pass it the in/out streams.

import lpjsmin
lpjsmin.minify_stream(
    open('static/js/myapp.js'),
    open('/tmp/myapp.minified.js', 'w')
)

News

0.1

Release date: 17-Feb-2011

  • Initial pulling out of the Launchpad utils directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lpjsmin-0.1.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file lpjsmin-0.1.tar.gz.

File metadata

  • Download URL: lpjsmin-0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lpjsmin-0.1.tar.gz
Algorithm Hash digest
SHA256 09996298a49bd12d2e3c2e57a25c5e415631bed18d956b159045df94560c454a
MD5 68a1f471cee839319dc3a495e3c2f3b3
BLAKE2b-256 6073c44a4a04bb20a3048b25937c1ace20510cb7f516016ee708bf3057016f7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page