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 -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
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')
)
stdin
~~~~~~
You can also just pass text at the script via stdin and it'll minimze it back
out to you.
::
$ cat file.js | lpjsmin
.. This is your project NEWS file which will contain the release notes.
.. Example: http://www.python.org/download/releases/2.6/NEWS.txt
.. The content of this file, along with README.rst, will appear in your
.. project's PyPI page.
News
====
0.7
---
*Release date: 19-December-2024*
* Add support for Python versions 3.9 to 3.13
* Drop support for Python 2 (Python 2.7 to be specific)
* Drop support for Python versions 3.5 to 3.7
* Drop "six" package dependency as Python 2 is no longer supported.
* Add pytest testing support and drop nose.
* Add pre-commit and linting
0.6
---
*Release date: 28-February-2020*
* Add tox testing support and drop buildout.
* Add Python 3 support.
* Use PEP 508 environment markers.
0.5
---
*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)
0.4
---
*Release date: 21-Feb-2012*
* Fix typo in the setup.py
0.3
----
*Release date: 21-Feb-2012*
* Add argparse as a conditional dep for older Python versions.
0.2
----
*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.
0.1
---
*Release date: 17-Feb-2012*
* Initial pulling out of the Launchpad utils directory.
Raw data
{
"_id": null,
"home_page": "https://launchpad.net/lpjsmin",
"name": "lpjsmin",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "javascript minification compress",
"author": "Rick Harding",
"author_email": "rharding@canonical.com",
"download_url": "https://files.pythonhosted.org/packages/ee/54/2d98adf0f262aa438a62792b18a20721c4b866f3c645dc2f6eb918be89d5/lpjsmin-0.7.tar.gz",
"platform": null,
"description": "lpjsmin for minifying js files\n===============================\n\nWe need to handle several minification goals within the Launchpad codebase.\nThis helps to create a single lib to help handle all of the cases and allow it\nto be flexibly used in more projects.\n\n\nUsage\n-----\n\ncmd line\n~~~~~~~~~\nYou can pass the cmd line `lpjsmin` either a filename or a directory and it'll\nprocess the file(s) adding a $fname-min.js next to the original file. This is\nused for things like minifying files in the combo directory. You can just let\nit know the root of the combo directory and it'll minify all files it finds in\nthere.\n\n::\n\n $ lpjsmin -p static/js/\n $ lpjsmin -p static/js/myapp.js\n\npython usage\n~~~~~~~~~~~~\nYou can import the module and minify in your own build scripts either via just\nfilename and directory.\n\n::\n\n import lpjsmin\n lpjsmin.minify('static/js')\n lpjsmin.minify('static/js/myapp.js')\n\nIf you need to be able to customize the name or location of the minified\nfiles, wrap the lpjsmin script in your own build script and pass it the in/out\nstreams.\n\n::\n\n import lpjsmin\n lpjsmin.minify_stream(\n open('static/js/myapp.js'),\n open('/tmp/myapp.minified.js', 'w')\n )\n\nstdin\n~~~~~~\nYou can also just pass text at the script via stdin and it'll minimze it back\nout to you.\n\n::\n\n $ cat file.js | lpjsmin\n\n\n.. This is your project NEWS file which will contain the release notes.\n.. Example: http://www.python.org/download/releases/2.6/NEWS.txt\n.. The content of this file, along with README.rst, will appear in your\n.. project's PyPI page.\n\nNews\n====\n\n0.7\n---\n*Release date: 19-December-2024*\n\n* Add support for Python versions 3.9 to 3.13\n* Drop support for Python 2 (Python 2.7 to be specific)\n* Drop support for Python versions 3.5 to 3.7\n* Drop \"six\" package dependency as Python 2 is no longer supported.\n* Add pytest testing support and drop nose.\n* Add pre-commit and linting\n\n\n0.6\n---\n*Release date: 28-February-2020*\n\n* Add tox testing support and drop buildout.\n* Add Python 3 support.\n* Use PEP 508 environment markers.\n\n\n0.5\n---\n*Release date: 11-June-2012*\n\n* Ignore any files that don't end in .js\n* Fix broken logic detecting if this file was already minified or not that\n allowed multiple nested minifications (filename-min-min-min.js)\n\n\n0.4\n---\n*Release date: 21-Feb-2012*\n\n* Fix typo in the setup.py\n\n\n0.3\n----\n*Release date: 21-Feb-2012*\n\n* Add argparse as a conditional dep for older Python versions.\n\n\n0.2\n----\n*Release date: 21-Feb-2012*\n\n* Move the file/directory based minifying to the -p/--path cmd line flag.\n* Support minifying off of stdin and sending to stdout if no path is\n specified.\n* Fix the ipdb dependency that should not have been there.\n\n0.1\n---\n\n*Release date: 17-Feb-2012*\n\n* Initial pulling out of the Launchpad utils directory.\n\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "JS Min script that provides cmd line and python processors",
"version": "0.7",
"project_urls": {
"Homepage": "https://launchpad.net/lpjsmin"
},
"split_keywords": [
"javascript",
"minification",
"compress"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "079ed724145ca4137c44f148bb66b3b38616de8aff41b5ae81223e9d7fc69571",
"md5": "149abd6f4c0a131a9e0586962adb4b12",
"sha256": "22af4bcb9978075dc7e2ac77e6cfd34d20d5eea0ff280087acd83ef87748c7b5"
},
"downloads": -1,
"filename": "lpjsmin-0.7-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "149abd6f4c0a131a9e0586962adb4b12",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 7958,
"upload_time": "2024-12-19T11:54:53",
"upload_time_iso_8601": "2024-12-19T11:54:53.708889Z",
"url": "https://files.pythonhosted.org/packages/07/9e/d724145ca4137c44f148bb66b3b38616de8aff41b5ae81223e9d7fc69571/lpjsmin-0.7-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ee542d98adf0f262aa438a62792b18a20721c4b866f3c645dc2f6eb918be89d5",
"md5": "2ffc201429d6bc4adfb2204258a6d896",
"sha256": "e764d1ae4c2f1f0b9bfdafa760c9f133948b4556f14a3268f2d54e5eb642ee0e"
},
"downloads": -1,
"filename": "lpjsmin-0.7.tar.gz",
"has_sig": false,
"md5_digest": "2ffc201429d6bc4adfb2204258a6d896",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9807,
"upload_time": "2024-12-19T11:54:56",
"upload_time_iso_8601": "2024-12-19T11:54:56.497013Z",
"url": "https://files.pythonhosted.org/packages/ee/54/2d98adf0f262aa438a62792b18a20721c4b866f3c645dc2f6eb918be89d5/lpjsmin-0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-19 11:54:56",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lpjsmin"
}