Skip to main content

MinifyJS

minifyjs Logo

A native JavaScript minifier and optimizer, driven from Python or the command line. No Node.js, no npm, no JavaScript runtime — the engine is a single self-contained binary. Repo:https://github.com/aldanedev-create/minifyjs

check doc website for more : MinifyJs-website

$ pip install minifyjs
$ minifyjs app.js -o app.min.js
from minifyjs import minify

result = minify("function add(a, b) { return a + b; }")
print(result.code)
# function add(a,b){return a+b;}

Why

JavaScript tooling usually means installing Node.js and a package manager before you can minify a file. MinifyJS ships as a native executable inside a platform-specific Python wheel: one pip install and you have a working minifier, with no JavaScript ecosystem on the machine.

How it works

MinifyJS is a thin, opinionated wrapper around esbuild's Go API. esbuild does the parsing, optimization, mangling, and code generation — the same engine that powers production builds at scale — and MinifyJS adds:

  • A stable Python API with typed options and structured diagnostics.
  • A native CLI with sane defaults and predictable exit codes.
  • A single-binary distribution model (no Node.js, no toolchain).
  • Framework-agnostic integration points for build systems that need minification as a step rather than as a Node tool.

The Go source of esbuild is compiled into the MinifyJS binary. Nothing shells out to Node, and nothing downloads a JavaScript runtime at install time.

Install

Python

pip install minifyjs

Requires Python 3.8+. Wheels are published for Linux (x86-64, aarch64), macOS (x86-64, arm64), and Windows (x86-64).

CLI only

Download the appropriate binary from the releases page and put it on your PATH. The Python package is not required to use the CLI, but it is the easiest way to get the binary.

Usage

Command line

minifyjs input.js -o output.js
minifyjs input.js --compress --mangle
cat input.js | minifyjs > output.js
minifyjs --version
minifyjs --help

Python

from minifyjs import minify, optimize, Options

# Whitespace/comments only
result = minify(source)

# Full optimization + identifier mangling
result = optimize(source)

# Explicit control
result = minify(source, Options(compress=True, mangle=True))
print(result.code)
print(f"{result.original_bytes} -> {result.minified_bytes} bytes")
for d in result.diagnostics:
    print(d)

See docs/python/ for the full API reference.

Documentation

Status

Pre-1.0. The API is stable enough to depend on; the on-disk format of the bundled binary may still change between minor versions.

License

MIT. See LICENSE.

Acknowledgements

MinifyJS would not exist without esbuild, which provides the JavaScript parsing and optimization engine. esbuild is MIT-licensed and is compiled into MinifyJS's native binary.

Metadata

Release files for minifyjs 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for minifyjs 0.1.2
File Actions
minifyjs-0.1.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for minifyjs-0.1.2-py3-none-win_amd64.whl
minifyjs-0.1.2-py3-none-manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for minifyjs-0.1.2-py3-none-manylinux2014_x86_64.whl
minifyjs-0.1.2-py3-none-manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for minifyjs-0.1.2-py3-none-manylinux2014_aarch64.whl
minifyjs-0.1.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for minifyjs-0.1.2-py3-none-macosx_11_0_arm64.whl
minifyjs-0.1.2-py3-none-macosx_10_13_x86_64.whl Python 3 none macOS 10.13+ x86-64 Details for minifyjs-0.1.2-py3-none-macosx_10_13_x86_64.whl

Total release size: 17.9 MB

Release files / minifyjs-0.1.2-py3-none-win_amd64.whl

Download URL minifyjs-0.1.2-py3-none-win_amd64.whl
Size 3.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
8c3ea03f3143e495440d93f517c08705725573ba2efc75db5d7942b7cf3e41c6
BLAKE2b-256 checksum
How to use checksums
2191bc02d93f917711e18df5abef9ad889c2a323d05ba446a8540d5cc18729da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / minifyjs-0.1.2-py3-none-manylinux2014_x86_64.whl

Download URL minifyjs-0.1.2-py3-none-manylinux2014_x86_64.whl
Size 3.7 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
d7421a6c3439b37b9ea1881770ef6d54ca463f6748df5f67ed6f4a4ead2b64c8
BLAKE2b-256 checksum
How to use checksums
ea91bb7b8e389a4eccd7fc8de3f9e2044b179ffa95baee3cab10dfe4853a0f44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / minifyjs-0.1.2-py3-none-manylinux2014_aarch64.whl

Download URL minifyjs-0.1.2-py3-none-manylinux2014_aarch64.whl
Size 3.3 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
d3796b7791bced397ba5ddeb8e08ce24782268908d96e339072e0cfd75005b65
BLAKE2b-256 checksum
How to use checksums
26e12545538e399075871e92d7807f2185b102a529014fbbd49ed142587e1b81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / minifyjs-0.1.2-py3-none-macosx_11_0_arm64.whl

Download URL minifyjs-0.1.2-py3-none-macosx_11_0_arm64.whl
Size 3.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9f46ee348cf2aad38b9c1ebfeacc79da2b3f629467d9763e72de27ea24aec54e
BLAKE2b-256 checksum
How to use checksums
a2eb3dd6c09e5233fbf696a2a2a7afeab5ac2132c5dfb5907ebc2948aaaa9296
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / minifyjs-0.1.2-py3-none-macosx_10_13_x86_64.whl

Download URL minifyjs-0.1.2-py3-none-macosx_10_13_x86_64.whl
Size 3.7 MB
Tags Python 3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
17af4764cd4895f46ce2a7990e230e66c58ec21ff054f8765ea97880fa3826c3
BLAKE2b-256 checksum
How to use checksums
7ad9f07a80b9f03e853d7902f15d10dd53403aec993be1d298d24a40d0ff2908
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for minifyjs 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page