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.


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 -p static/js/
$ lpjsmin -p 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

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
    open('/tmp/myapp.minified.js', 'w')


You can also just pass text at the script via stdin and it’ll minimze it back out to you.

$ cat file.js | lpjsmin



  • Add tox testing support and drop buildout.

  • Add Python 3 support.

  • Use PEP 508 environment markers.


Release date: 11-June-2012

  • Ignore any files that don’t end in .js

  • Fix broken logic detecting if this file was already minified or not that allowed multiple nested minifications (filename-min-min-min.js)


Release date: 21-Feb-2012

  • Fix typo in the


Release date: 21-Feb-2012

  • Add argparse as a conditional dep for older Python versions.


Release date: 21-Feb-2012

  • Move the file/directory based minifying to the -p/–path cmd line flag.

  • Support minifying off of stdin and sending to stdout if no path is specified.

  • Fix the ipdb dependency that should not have been there.


Release date: 17-Feb-2012

  • 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.6.tar.gz (7.1 kB view hashes)

Uploaded source

Built Distribution

lpjsmin-0.6-py2.py3-none-any.whl (10.0 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page