MinifyJS
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
- Getting started
- CLI reference
- Python API
- Engine and esbuild integration
- Architecture
- Contributing
- Security policy
- Roadmap
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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 24.6 MB
Release files / minifyjs-0.1.3-py3-none-win_amd64.whl
| Download URL | minifyjs-0.1.3-py3-none-win_amd64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8d7d403aa72d113c2c8ea91d9e493053b0284a3b860ce30e9a1fcf30556117bb
|
|
BLAKE2b-256 checksum How to use checksums |
348a3519fe34a6c7c42e11b731f23f03af2508f3afd8e444b93c3df294592200
|
| 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.3-py3-none-musllinux_1_2_x86_64.whl
| Download URL | minifyjs-0.1.3-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
ee95079f5d27015958350e0c0b8ec0097acaa152c018b3d350627e148e8f9c05
|
|
BLAKE2b-256 checksum How to use checksums |
b57ebe83e08e8296ea23a9f6a7f37b5394326aa3513876fd1d0200d382709438
|
| 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.3-py3-none-musllinux_1_2_aarch64.whl
| Download URL | minifyjs-0.1.3-py3-none-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Linux musl 1.2+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
f5f80e35ac6fe1cfc07564e94aebc015a03a4a14526f7be1531c857b51326d80
|
|
BLAKE2b-256 checksum How to use checksums |
787f1ba96fb066ab3ebc5b80bdd47fa92f1dc02301f02ad8fb8088488c8f1f75
|
| 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.3-py3-none-manylinux2014_x86_64.whl
| Download URL | minifyjs-0.1.3-py3-none-manylinux2014_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
59d604571ba9860717bf6f94828c46c9878d8c5dea6220e118da4233944424f8
|
|
BLAKE2b-256 checksum How to use checksums |
8e818ade7212ca1503d01d68561f217acb87119813ea3635e8d0e1e71ea83fc9
|
| 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.3-py3-none-manylinux2014_aarch64.whl
| Download URL | minifyjs-0.1.3-py3-none-manylinux2014_aarch64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
fd0fdb0310d41e507f41246e6a34ac9ec68597e9f343743630b4d4f7a3856c73
|
|
BLAKE2b-256 checksum How to use checksums |
98846bfa05f63cca95b395795b728ef82f90dc4e9a575afdcd61da2beb0bb145
|
| 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.3-py3-none-macosx_11_0_arm64.whl
| Download URL | minifyjs-0.1.3-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 |
a9f868aa836516cace16abc1215fe6c15a31f4008a31f66aeb7419ff39d24da8
|
|
BLAKE2b-256 checksum How to use checksums |
b8be4e66ab8ac4e923c8c93666e840660b318a5f1736f1ae745f8150276e4046
|
| 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.3-py3-none-macosx_10_13_x86_64.whl
| Download URL | minifyjs-0.1.3-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 |
1df783aed9138b70d8a9981901d2f64d152e4832bbdcc8b3eb61c036cb4877bd
|
|
BLAKE2b-256 checksum How to use checksums |
8a84a7f7c32968b942eafd6548e0da1ec6f1f88e381544cfcf12b95ef990685f
|
| 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.3
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.