rjsmin
Javascript Minifier
What it is and what it does
rjsmin is a JavaScript minifier written in Python, based on the semantics of Douglas Crockford's jsmin.c. It removes whitespace, comments, and other unnecessary characters from JavaScript code while preserving functionality. The package includes an optional C reimplementation (rjsmin.c) for additional speed. Unlike the original jsmin.c, rjsmin does not perform error detection on malformed input; instead, it treats unterminated strings, regexes, and comments as regular code. It supports modern JavaScript features including template literals (ECMA-6) and optional preservation of comments starting with exclamation marks.
The package is designed for runtime use rather than as a preprocessing step, making it suitable for dynamic JavaScript generation or on-demand minification. It provides both a direct API and a "streamy" interface for handling complete strings. With no runtime dependencies and support for Python 2.7 and 3.6 through 3.14, rjsmin is a lightweight, portable choice for projects needing fast JavaScript compression.
Use it for:
- Minify JavaScript on-the-fly in web applications serving dynamically generated scripts.
- Reduce payload size for JavaScript bundles in build pipelines or asset servers.
- Strip comments and whitespace from JavaScript code during template rendering.
- Optimize JavaScript responses in APIs or microservices that generate client-side code.
- Compress JavaScript in embedded or constrained environments where preprocessing is impractical.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
rjsmin minifies JavaScript code by removing unnecessary characters while preserving functionality, implemented in Python with optional C acceleration for runtime use.
Yes, if you need runtime JavaScript minification in Python and can tolerate the aging maintenance status. The package is stable (Production/Stable classifier), has no known vulnerabilities, and offers good performance through optional C acceleration. However, consider the 306-day release gap when evaluating long-term support; if you require active maintenance or are starting a new project, evaluate whether a more actively maintained alternative better fits your risk tolerance.
Install
rjsmin on PyPI
pip
pip install rjsminuv
uv add rjsminpoetry
poetry add rjsminInstalling rjsmin
Before you install
Medium install friction due to compiled C extension wheels; prebuilt binaries available for Python 2.7 and 3.6–3.14 on multiple platforms (manylinux, musllinux, aarch64), but package is aging with no release in 306 days.
License in practice
Apache License 2.0 (permissive) allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install rjsmin
import rjsmin
minified = rjsmin.jsmin('var x = 1; // comment')
Verify before relying
- Whether the C extension is automatically used or requires explicit configuration.
- Current maintenance status and likelihood of future updates beyond the 306-day gap.
- Real-world performance gains compared to other JavaScript minifiers in modern Python environments.
Package facts
| License | Apache License, Version 2.0 (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 306 days since the last release |
| First released | |
| Downloads | 2,993,182/month — #2,796 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rjsmin-1.2.5-cp27-cp27m-manylinux1_i686.whl; rjsmin-1.2.5-cp27-cp27m-manylinux1_x86_64.whl; rjsmin-1.2.5-cp27-cp27mu-manylinux1_i686.whl; rjsmin-1.2.5-cp27-cp27mu-manylinux1_x86_64.whl; rjsmin-1.2.5-cp310-cp310-manylinux1_i686.whl; rjsmin-1.2.5-cp310-cp310-manylinux1_x86_64.whl; rjsmin-1.2.5-cp310-cp310-manylinux2014_aarch64.whl; rjsmin-1.2.5-cp310-cp310-musllinux_1_1_aarch64.whl; rjsmin-1.2.5-cp310-cp310-musllinux_1_1_i686.whl; rjsmin-1.2.5-cp310-cp310-musllinux_1_1_x86_64.whl; rjsmin-1.2.5-cp311-cp311-manylinux1_i686.whl; rjsmin-1.2.5-cp311-cp311-manylinux1_x86_64.whl; rjsmin-1.2.5-cp311-cp311-manylinux2014_aarch64.whl; rjsmin-1.2.5-cp311-cp311-musllinux_1_1_aarch64.whl; rjsmin-1.2.5-cp311-cp311-musllinux_1_1_i686.whl; rjsmin-1.2.5-cp311-cp311-musllinux_1_1_x86_64.whl; rjsmin-1.2.5-cp312-cp312-manylinux1_i686.whl; rjsmin-1.2.5-cp312-cp312-manylinux1_x86_64.whl; rjsmin-1.2.5-cp312-cp312-manylinux2014_aarch64.whl; rjsmin-1.2.5-cp312-cp312-musllinux_1_1_aarch64.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
jsminMinifies JavaScript code by removing…
permissive · top 5,000 on PyPI
rcssminRCSSmin minifies CSS by removing spaces,…
permissive · top 5,000 on PyPI
minify-htmlMinifies HTML, JavaScript, and CSS in a single…
permissive · top 5,000 on PyPI
htmlminMinifies HTML by removing unnecessary…
permissive · top 5,000 on PyPI
JSON_minifyMinifies JSON by removing whitespace and…
permissive · top 15,000 on PyPI
htmlmin2Minifies HTML by removing unnecessary…
permissive · top 5,000 on PyPI
python-minifierTransforms Python source code into compact,…
permissive · top 15,000 on PyPI
Flask-MinifyFlask extension that automatically minifies…
permissive · top 15,000 on PyPI
mkdocs-minify-pluginMinifies HTML, JavaScript, and CSS files in…
permissive · top 5,000 on PyPI
jsiijsii is a Python runtime client that enables…
permissive · top 5,000 on PyPI