{ "info": { "author": "Tommy Yu", "author_email": "tommy.yu@auckland.ac.nz", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "crimp\n=====\n\nA JavaScript minifier command-line utility written fully in Python; uses\n|calmjs.parse|_ as the underlying library.\n\n.. image:: https://travis-ci.org/calmjs/crimp.svg?branch=1.0.1\n :target: https://travis-ci.org/calmjs/crimp\n.. image:: https://ci.appveyor.com/api/projects/status/nmtjoh4mavbilgvo/branch/1.0.1?svg=true\n :target: https://ci.appveyor.com/project/metatoaster/crimp/branch/1.0.1\n.. image:: https://coveralls.io/repos/github/calmjs/crimp/badge.svg?branch=1.0.1\n :target: https://coveralls.io/github/calmjs/crimp?branch=1.0.1\n\n.. |crimp| replace:: ``crimp``\n.. |calmjs.parse| replace:: ``calmjs.parse``\n.. _calmjs.parse: https://pypi.python.org/pypi/calmjs.parse\n.. |slimit| replace:: ``slimit``\n.. _slimit: https://pypi.python.org/pypi/slimit\n\n\nIntroduction\n------------\n\n|crimp| serves as the front-end to |calmjs.parse|_.\n\nBoth these libraries had their origin in |slimit|_, a package that\nprovided a Python based solution for handling JavaScript code, which is\noften used for situations where the usage of commonly used minifiers,\nwhich are typically written in Node.js, is impractical from a pure\nPython environment. However, |slimit| had not been maintained for a\nnumber of years. As of 2017, with many issues that impacted the\ncorrectness of the generated code remain outstanding, |calmjs.parse| was\nforked from |slimit|, and |crimp| was created as a front end for the\nformer.\n\n\nInstallation\n------------\n\nThe following command may be executed to source the latest stable\nversion of |crimp| wheel from PyPI for installation into the current\nPython environment.\n\n.. code:: sh\n\n $ pip install crimp\n\n\nUsage\n-----\n\nAs |crimp| is a package that offers a command of the same name,\nexecuting the command after installation with the ``--help`` flag will\nreveal the options that are available.\n\n.. code::\n\n $ crimp --help\n usage: crimp [input_file [input_file ...]] [-h] [-O ] [-m] [-p]\n [-s []] [--version] [-o] [--drop-semi]\n [--indent-width n] [--encoding ]\n\n positional arguments:\n input_file path(s) to input file(s)\n\n optional arguments:\n -h, --help show this help message and exit\n -O , --output-path \n output file path\n -m, --mangle enable all basic mangling options\n -p, --pretty-print use pretty printer (omit for minify printer)\n -s [], --source-map []\n enable source map; filename defaults to\n .map, if identical to it\n will be written inline as a data url\n --version show version information\n --indent-width n indentation width for pretty printer\n --encoding the encoding for file-based I/O; stdio relies on\n system locale\n\n basic mangling options:\n -o, --obfuscate obfuscate (mangle) names\n --drop-semi drop unneeded semicolons (minify printer only)\n\nTypically, the program will be invoked with a single or multiple input\nfiles (if they are to be combined into a single file), and optionally\nwith the ``-m`` flag to denote that it is safe to have all the mangle\noptions enabled.\n\nPlease note that all input files *must* be listed before the flags, as\nthis forced grouping of all input files result in a less ambiguous\nlisting of files, given that there are flags for specifying target\noutput files, which will be overwritten without prompt.\n\n\nStandard pretty/minified printing\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo minify some file:\n\n.. code::\n\n $ crimp project.js -O project.min.js\n\nTo minify some file with just variable name obfuscation:\n\n.. code::\n\n $ crimp project.js -m -O project.min.js\n\nPretty printing the minified file back onto stdout:\n\n.. code::\n\n $ crimp project.min.js -p\n\nReading input from stdin and writing out to a file. Note that if a\nSIGINT (typically Ctrl-C or Ctrl-Break), the output file will not be\nopened for writing.\n\n.. code::\n\n $ crimp -O demo.js\n\nSource map generation\n~~~~~~~~~~~~~~~~~~~~~\n\nFor source map generation, enable the ``-s`` flag.\n\n.. code::\n\n $ crimp project.js -O project.min.js -s\n\nThe above will write out the source map file as ``project.min.js.map``,\nand the reference to that (the ``sourceMappingURL``) will also be\nappended to the output file as a comment. To specify a specific\nlocation, pass the name as a parameter.\n\n.. code::\n\n $ crimp project.js -O project.min.js -s project.min.map\n\nInline source maps (where the ``sourceMappingURL`` is the data URL of\nthe base64 encoding of the JSON serialization of the source map) are\nsupported; these can be produced by supplying the argument with the same\nname used for the output file, like so:\n\n.. code::\n\n $ crimp project.js -O project.min.js -s project.min.js\n\n\nTroubleshooting\n---------------\n\nParsing a moderately sized file takes 10x as much time as uglifyjs\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis is due to the implementation done by |calmjs.parse| as a set of\ngenerator functions that produce very minimum output, and that the\nstandard Python implementation has a very high overhead performance cost\nfor function calls. The advantage with that approach is that maximum\nflexibility can be achieved (due to the ease of which unparsing\nworkflows can be set up), while the drawback is obvious.\n\n\nContribute\n----------\n\n- Issue Tracker: https://github.com/calmjs/crimp/issues\n- Source Code: https://github.com/calmjs/crimp\n\n\nLegal\n-----\n\nThe |crimp| package is copyright (c) 2017 Auckland Bioengineering\nInstitute, University of Auckland. The |crimp| package is licensed\nunder the MIT license (specifically, the Expat License).\n\nChangelog\n=========\n\n1.0.1 - 2018-08-11\n------------------\n\n- Bumping minimum version of ``calmjs.parse`` to ``1.1.1``, which\n includes fixes to:\n\n - Line continuation in JavaScript sources should no longer break\n source map line counting. [\n `calmjs.parse#16 `_\n ]\n - Will no longer parse certain incorrectly unterminated statements as\n valid JavaScript. [\n `calmjs.parse#18 `_\n ]\n - Obfuscated minifier should no longer truncate certain closing braces\n as the internal accounting is corrected. [\n `calmjs.parse#19 `_\n ]\n\n1.0.0 - 2017-09-26\n------------------\n\nInitial release.\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/calmjs/crimp", "keywords": "", "license": "mit", "maintainer": "", "maintainer_email": "", "name": "crimp", "package_url": "https://pypi.org/project/crimp/", "platform": "", "project_url": "https://pypi.org/project/crimp/", "project_urls": { "Homepage": "https://github.com/calmjs/crimp" }, "release_url": "https://pypi.org/project/crimp/1.0.1/", "requires_dist": [ "calmjs.parse (>=1.1.1)" ], "requires_python": "", "summary": "JavaScript (ES5) minifier", "version": "1.0.1" }, "last_serial": 4159160, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "2e817b3141c3a59c2f3c388761b78fd4", "sha256": "069a7bcb7bc8637bdfbee203252c12113a8ec13c6f3b4a241c71ddb5dbab16df" }, "downloads": -1, "filename": "crimp-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2e817b3141c3a59c2f3c388761b78fd4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14181, "upload_time": "2017-09-26T16:15:58", "url": "https://files.pythonhosted.org/packages/cd/27/b5423153f8cbbe3584ae525a67629c6c0aec9636ebe490cd73025428fbea/crimp-1.0.0-py2.py3-none-any.whl" } ], "1.0.0.dev0": [], "1.0.1": [ { "comment_text": "", "digests": { "md5": "7a866a95142c9f7d8fc53aa741f957b9", "sha256": "a38b6e1702287fbc5eca8923e486f4198e5b217d28405022792582ea6d431bab" }, "downloads": -1, "filename": "crimp-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7a866a95142c9f7d8fc53aa741f957b9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11113, "upload_time": "2018-08-11T06:47:34", "url": "https://files.pythonhosted.org/packages/fc/fc/aea5cb48108aef471a6ce32665e6ea9f3d5339632c458147aac44aae3751/crimp-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c70c9d83ea95265b263d5abfc044c162", "sha256": "7cc287d19c5ad914b59ab8959915f473235d35b3f6c036ceddbef052f4ea7caf" }, "downloads": -1, "filename": "crimp-1.0.1.zip", "has_sig": false, "md5_digest": "c70c9d83ea95265b263d5abfc044c162", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17925, "upload_time": "2018-08-11T06:47:35", "url": "https://files.pythonhosted.org/packages/ef/1b/7070821d5ef0c14ccc63c0261f5477587506f3c5b3ce6fa4d395ad3d3703/crimp-1.0.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7a866a95142c9f7d8fc53aa741f957b9", "sha256": "a38b6e1702287fbc5eca8923e486f4198e5b217d28405022792582ea6d431bab" }, "downloads": -1, "filename": "crimp-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7a866a95142c9f7d8fc53aa741f957b9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11113, "upload_time": "2018-08-11T06:47:34", "url": "https://files.pythonhosted.org/packages/fc/fc/aea5cb48108aef471a6ce32665e6ea9f3d5339632c458147aac44aae3751/crimp-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c70c9d83ea95265b263d5abfc044c162", "sha256": "7cc287d19c5ad914b59ab8959915f473235d35b3f6c036ceddbef052f4ea7caf" }, "downloads": -1, "filename": "crimp-1.0.1.zip", "has_sig": false, "md5_digest": "c70c9d83ea95265b263d5abfc044c162", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17925, "upload_time": "2018-08-11T06:47:35", "url": "https://files.pythonhosted.org/packages/ef/1b/7070821d5ef0c14ccc63c0261f5477587506f3c5b3ce6fa4d395ad3d3703/crimp-1.0.1.zip" } ] }