minifyjs
Python bindings for MinifyJS, a native JavaScript minifier and optimizer. No Node.js required.
Install
pip install minifyjs
Use
from minifyjs import minify
result = minify("function add(a, b) { return a + b; }")
print(result.code)
# function add(a,b){return a+b;}
Full optimization and identifier mangling:
from minifyjs import optimize
result = optimize("const x = 1 + 2 + 3;")
print(result.code) # const x=6;
Explicit control:
from minifyjs import minify, Options
result = minify(source, Options(
compress=True,
mangle=True,
target="es2015",
sourcemap="inline",
))
Bundling:
from minifyjs import bundle
result = bundle("src/main.js", outdir="dist", format="esm")
Adapter for frameworks
MinifyJS ships a generic adapter (minifyjs.adapter) that any
framework or build system can subclass. See
docs/integrations/generic-python.md
for how to write an adapter for Django, Flask, FastAPI, or a custom
build pipeline.
Command line
The native minifyjs binary is installed alongside the Python
package:
minifyjs app.js -o app.min.js
minifyjs app.js --compress --mangle
cat app.js | minifyjs
Or, without the binary on PATH:
python -m minifyjs --version
Documentation
See the main repository's docs/python/.
License
MIT.
Metadata
Release files for minifyjs 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| minifyjs-0.1.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for minifyjs-0.1.0-py3-none-win_amd64.whl |
| minifyjs-0.1.0-py3-none-manylinux2014_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details for minifyjs-0.1.0-py3-none-manylinux2014_x86_64.whl |
| minifyjs-0.1.0-py3-none-manylinux2014_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details for minifyjs-0.1.0-py3-none-manylinux2014_aarch64.whl |
| minifyjs-0.1.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for minifyjs-0.1.0-py3-none-macosx_11_0_arm64.whl |
| minifyjs-0.1.0-py3-none-macosx_10_13_x86_64.whl | Python 3 | none | macOS 10.13+ x86-64 | Details for minifyjs-0.1.0-py3-none-macosx_10_13_x86_64.whl |
Total release size: 17.9 MB
Release files / minifyjs-0.1.0-py3-none-win_amd64.whl
| Download URL | minifyjs-0.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7a04c9c7458a0ed398150c211bd98e624493daff2e9c3aa8f34c2daef6cd265a
|
|
BLAKE2b-256 checksum How to use checksums |
d615d356f0afe59c0266cad8d6104db2150a2a7a1c55b7b4ceba7579ff99ad64
|
| 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.0-py3-none-manylinux2014_x86_64.whl
| Download URL | minifyjs-0.1.0-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 |
664390ce2e3e2f648cc91b88b4a2fd0ecdf6313d76e613897351541ba2db1916
|
|
BLAKE2b-256 checksum How to use checksums |
2d93a066510b189fe26667269dc1fab08404ef0bcc96670a32838c3c31d89ba5
|
| 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.0-py3-none-manylinux2014_aarch64.whl
| Download URL | minifyjs-0.1.0-py3-none-manylinux2014_aarch64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
f6d72d459c8c69419b4080a3824a942a534ede54c2719458155dd705fd2582e2
|
|
BLAKE2b-256 checksum How to use checksums |
2cec37dbd4ba2d3a8b5542015c548c10b3ef6ac55724b17e8103b0b139783d73
|
| 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.0-py3-none-macosx_11_0_arm64.whl
| Download URL | minifyjs-0.1.0-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 |
094c4617e2b77ddfcb594759f91be1bedcd75e1d24c7a4be8ab752ed944892be
|
|
BLAKE2b-256 checksum How to use checksums |
fdf3c0c489975f52acae86f974b3d00596c5034ed852901c164ce18e5ff8a914
|
| 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.0-py3-none-macosx_10_13_x86_64.whl
| Download URL | minifyjs-0.1.0-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 |
61addd60ef054dabce43e5c9fd4332f727e25ec7ab445ac2018dd1ade068e25f
|
|
BLAKE2b-256 checksum How to use checksums |
0b5957293da6d9b59f219f39976eb2a302a75f71a1e29c49e49e4316f787d98e
|
| 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.0
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.