jsmin
JavaScript minifier.
What it is and what it does
jsmin is a Python library that compresses JavaScript source code by stripping whitespace, comments, and other non-essential characters while preserving code behavior. It works as both a Python function you can call on JavaScript strings and as a standalone command-line tool.
The package has no external runtime dependencies, making it lightweight to install. However, it explicitly does not support ECMAScript 6 or later syntax—the maintainer has stated no intention to add ES6 compatibility. If you need to minify modern JavaScript, you may need to preprocess your code or use an alternative tool. The library does offer a `quote_chars` parameter for limited workarounds on newer syntax.
Use it for:
- Build pipelines that need to compress JavaScript assets before deployment to reduce file size.
- Development tools that process legacy ES5 JavaScript code to optimize distribution.
- Automated scripts that strip comments and whitespace from JavaScript files during packaging.
- Web applications serving static JavaScript where bandwidth reduction is a priority.
- Integration into Python-based build systems that already handle JavaScript as part of a larger workflow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Minifies JavaScript code by removing unnecessary characters while preserving functionality, available as both a Python library and command-line tool.
Yes, if you are minifying ES5 JavaScript only. The package is stable, has no vulnerabilities, and works reliably for its stated purpose. No, if you need ES6+ support—the maintainer explicitly will not add it. Consider alternatives if your codebase uses modern JavaScript syntax. The high install friction and dormant maintenance status are acceptable trade-offs for a simple, focused tool with no dependencies, but do not expect active development.
Install
jsmin on PyPI
pip
pip install jsminuv
uv add jsminpoetry
poetry add jsminInstalling jsmin
Before you install
High install friction due to source distribution only. Package is dormant—last release was 2022-01-16, though the repository remains active with recent commits. No runtime dependencies simplifies installation once obtained.
License in practice
MIT License (permissive) imposes no restrictions on use, modification, or redistribution in commercial or private projects.
Quickstart
pip install jsmin
from jsmin import jsmin
with open('myfile.js') as js_file:
minified = jsmin(js_file.read())
# Or from command line:
python -m jsmin myfile.js
Python 2 support was removed in version 3.0.0; requires Python 3 only.
Verify before relying
- Whether ES6+ JavaScript is reliably handled; documentation explicitly states no ES6 compatibility is intended.
- Current maintenance likelihood and likelihood of future updates given time since last release.
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 1,671 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,232,124/month — #4,185 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jsmin-3.0.1.tar.gz
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
htmlmin2Minifies HTML by removing unnecessary…
permissive · top 5,000 on PyPI
rjsminrjsmin minifies JavaScript code by removing…
permissive · top 5,000 on PyPI
htmlminMinifies HTML by removing unnecessary…
permissive · top 5,000 on PyPI
python-minifierTransforms Python source code into compact,…
permissive · top 15,000 on PyPI
cssminCompresses CSS files by removing unnecessary…
unclear · top 15,000 on PyPI
mkdocs-minify-pluginMinifies HTML, JavaScript, and CSS files in…
permissive · top 5,000 on PyPI
jsbeautifierBeautifies, unpacks, and deobfuscates…
permissive · top 5,000 on PyPI
JSON_minifyMinifies JSON by removing whitespace and…
permissive · top 15,000 on PyPI
csscompressorCompresses CSS by removing unnecessary…
permissive · top 5,000 on PyPI
Flask-MinifyFlask extension that automatically minifies…
permissive · top 15,000 on PyPI