skillfed

jsmin

JavaScript minifier.

jsmin v3.0.1 1.2M downloads/30d#4,185 on PyPI93
Permissive license MIT License DORMANT released

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 jsmin

uv

uv add jsmin

poetry

poetry add jsmin

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Pre-processorsTopic :: Text Processing :: Filters

Tags

javascript minifierminify js coderemove whitespace javascriptcompress javascriptjs code optimizerstrip comments javascriptreduce file size js
minificationbuild-toollegacy-js

More Dynamic Content packages