--- id: rjsmin version: "1.2.5" license: Apache License, Version 2.0 license_treatment: permissive maintenance: aging --- # rjsmin — Javascript Minifier License: permissive · Maintenance: aging · Downloads: 3.0M/mo ## 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 above — 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 pip install rjsmin uv add rjsmin poetry add rjsmin ## Installing 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: unspecified - Install friction: medium - Maintenance: aging - Downloads: 3.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags javascript minifier python, minify js code, javascript compression, remove whitespace javascript, optimize javascript size, runtime js minification, jsmin implementation, minification, javascript, web-assets [View on SkillFed](https://skillfed.io/packages/rjsmin) · [View on PyPI](https://pypi.org/project/rjsmin/)