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

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.1
File Actions
minifyjs-0.1.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for minifyjs-0.1.1-py3-none-win_amd64.whl
minifyjs-0.1.1-py3-none-manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for minifyjs-0.1.1-py3-none-manylinux2014_x86_64.whl
minifyjs-0.1.1-py3-none-manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for minifyjs-0.1.1-py3-none-manylinux2014_aarch64.whl
minifyjs-0.1.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for minifyjs-0.1.1-py3-none-macosx_11_0_arm64.whl
minifyjs-0.1.1-py3-none-macosx_10_13_x86_64.whl Python 3 none macOS 10.13+ x86-64 Details for minifyjs-0.1.1-py3-none-macosx_10_13_x86_64.whl

Total release size: 17.9 MB

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

Download URL minifyjs-0.1.1-py3-none-win_amd64.whl
Size 3.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6f9cdf7b77f368ebf40b3333186d54c17e04b290686265aded85dafe59f4896b
BLAKE2b-256 checksum
How to use checksums
fea5c0a1e10d1232e409e678eed575c261d6d38a2d85ca654455f0648eff828f
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.1-py3-none-manylinux2014_x86_64.whl

Download URL minifyjs-0.1.1-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
643c88cc7b1716cc33324eaabbdaf8130c0799749db20a1a86e2f0da0124c32d
BLAKE2b-256 checksum
How to use checksums
03febd3a113eb3e9831fb43f4abdcdde3352c98df725150dfeaaad23d884948d
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.1-py3-none-manylinux2014_aarch64.whl

Download URL minifyjs-0.1.1-py3-none-manylinux2014_aarch64.whl
Size 3.3 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
bbaef7aa0cf3d38db88de3e7c201fd2042f67ce10a8e9b9de83b8e185bcc8d9c
BLAKE2b-256 checksum
How to use checksums
e42f980ba8439c67e767c609bc90c0efe3c6144c1daa9a6b44942cbeec5451dc
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.1-py3-none-macosx_11_0_arm64.whl

Download URL minifyjs-0.1.1-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
2e92fe2c634f79c6c97f4f1b468fd5cb3245b65772f872e409619be7231a377e
BLAKE2b-256 checksum
How to use checksums
11fc4c766e2794cc94e0d1b60c7db31783cfa70c79a40c19dfb611f91f0c86e0
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.1-py3-none-macosx_10_13_x86_64.whl

Download URL minifyjs-0.1.1-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
50edbdf8c867166a3acbb036ec301e0c18832c4ecd7b7c681a4ad775f4707f7a
BLAKE2b-256 checksum
How to use checksums
4658b4101d5a0bd3e8db80e758ac8e04f55f1cb5b459e7eaa659115222a7eda8
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.1

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