skillfed

rjsmin

Javascript Minifier

rjsmin v1.2.5 3.0M downloads/30d#2,796 on PyPI
Permissive license Apache License, Version 2.0 AGING released

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 rjsmin

uv

uv add rjsmin

poetry

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 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: OS IndependentProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: JythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text ProcessingTopic :: Text Processing :: FiltersTopic :: Utilities

Tags

javascript minifier pythonminify js codejavascript compressionremove whitespace javascriptoptimize javascript sizeruntime js minificationjsmin implementation
minificationjavascriptweb-assets

More Libraries packages