minify's roadmap calls its SVG minifier very slow, and the readme and the manifest disagree on the Go version
Go minifiers for web formats
At a glance
- What is it?
- A look at a set of Go minifiers for web formats: a mimetype registry that minifies embedded CSS and JavaScript, bindings published to four package managers plus a Docker image, a release build for eight operating systems with CGO disabled, three of five direct dependencies written by the same author, a testing policy of full coverage plus fuzzing, and an API stability promise with one exception already spent.
- Who is it for?
- minify fits a Go service that has to shrink HTML, CSS, JavaScript, JSON, SVG or XML on the fly, including the CSS and JavaScript embedded inside an HTML response, and that would rather not shell out to a Node toolchain. It does not fit someone who needs source maps, who needs a bundler, or who is minifying SVG at volume, because all three are open roadmap items rather than features.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 3 days ago.
- What is it written in?
- Mainly Go, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- tdewolff/minify4,154 ★ · +13
| Repository | 2026-09-23 | 2026-11-15 |
|---|---|---|
| tdewolff/minify | 4.1k | 4.2k |
13 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The roadmap names three things that are not done, including the SVG minifier
The roadmap is six lines long and it is more informative than a feature list, because three of the six items are things the project has decided not to have finished.
The first open item is assembly and SIMD, to speed up the core parts of the parsers and minifiers. The second is the SVG minifier, and the description is blunt: it is very slow. That is a performance statement about one of the six formats the library claims to cover, and it is the reason this roadmap exists.
The third open item is source maps. The parenthetical explains why it has stayed open: generation is uncertain because it might slow down the parsers too much if it cannot run separately. So the reason is not that source maps are hard, it is that emitting them in the same pass would cost the thing the project is actually optimised for.
The fourth item is the largest. A command to pack web files, much like a bundler: merging CSS and JavaScript files, inlining small external files, minifying and gzipping, working on HTML files. In other words, the merging and inlining half of what a modern build tool does is not here.
Two items are ticked. The JavaScript minifiers were improved by shortening variables and by proper semicolon omission. And the parsers got proper error reporting with line and column information. Both of those are the kind of change that only shows up when you have read an error message once.
The readme says Go 1.18 and the module manifest says 1.25
The installation instructions open with the toolchain requirement, and the manifest disagrees with it.
The readme asks for Git and Go, with a version of 1.18 or higher. The module file declares a Go version of 1.25.0, which is a floor for the module's own language and tooling requirements.
The gap is about seven minor versions. If you take the readme at face value and build with Go 1.18, the module's declared requirement is what will stop you, and the error will come from the toolchain rather than from anything about minifiers.
The install steps themselves are four commands: create a directory, change into it, initialise a module with go mod init, and fetch the module with go get. Then you import the top-level package plus the one for each format you need:
import (
"github.com/tdewolff/minify/v2"
"github.com/tdewolff/minify/v2/css"
"github.com/tdewolff/minify/v2/html"
"github.com/tdewolff/minify/v2/js"
"github.com/tdewolff/minify/v2/json"
"github.com/tdewolff/minify/v2/svg"
"github.com/tdewolff/minify/v2/xml"
)There is an optional step to tidy the module files afterwards. And the readme is clear that this is the library route: for the binary, it points you at a separate command directory for installation instructions.
So there are two installs in this repository, and the version requirement that matters differs between them.
The release build targets eight operating systems with CGO disabled
The Makefile is where the project's release engineering shows, and it is short enough to read completely.
The target list has eight entries built from an operating system and an architecture: Linux and macOS each for amd64 and arm64, Windows for amd64, and FreeBSD, NetBSD and OpenBSD for amd64. Three BSDs in a minifier's release matrix is unusual, and it is the clearest statement about who this is for.
The build environment sets module mode on and disables CGO, so the binaries are statically linked with no libc dependency. The link flags strip the symbol table and the DWARF data, set a single main version variable, and trim the recorded file paths.
The release target refuses to run unless the commit is exactly on a tag. It checks for an exact tag match, and if that fails it prints an error saying the commit is not tagged with a version and exits. So a release cannot be cut from an untagged commit, which is a small guard that prevents the most embarrassing failure in a tag-driven release.
After each build the licence and a command line readme are copied into the distribution directory. Windows builds get an executable suffix and a zip; everything else gets a shell completion file and a gzip archive. Each archive's checksum is appended to one checksums file, the intermediate directory is removed, and the whole thing ends by running a publish script.
That last detail is worth noting: the checksums accumulate into a single file across all eight targets rather than being generated per archive.
One library, six ways to install it, and one of them lives in someone else's repository
The distribution story is broader than most single-language libraries manage, and it is laid out in the first screen of the readme.
The core is a Go module under a version 2 path, installed with go get. Then there are command line binaries for various platforms, published as release assets on the repository itself. There is an online demo for minifying files without installing anything. There is a Windows package installable with a single scoop command.
Then the bindings. A Python binding on PyPI, installed with pip. A JavaScript binding on npm, installed with the scoped package name. And a .NET binding, which is the interesting one: it lives in a different repository, on someone else's account, and the readme credits a named person for the port. It is installable with either a PowerShell package command or dotnet add package.
There is a Docker image as well, and the container story is short: the build stage uses a Go image on Alpine, installs a few build tools, and runs the project's own make install rather than a direct build command. The final image is Alpine, with the binary copied in and a shell script from a container subdirectory installed as the entrypoint.
So the .NET binding is the one component whose release cadence this repository does not control, and it is also the only one documented here as living elsewhere.
Three of the five direct dependencies are written by the same author
The module manifest has five direct requirements and three of them are the author's own modules.
There is a module for argument parsing, at a pseudo-version pinned to a specific commit rather than a release, which is a pattern that appears when a project depends on the tip of a dependency. There is a separate parsing module at a released version, and that one is the actual parser the minifiers sit on. And there is a third module that appears to be a testing helper, also at a released version.
That leaves two direct dependencies that are not the author's: one for file access time tracking, and one for filesystem notification.
The indirect list is more telling. It contains a fuzzing framework, a database library, a TOML parser, a system calls package and a YAML library. None of those are things a minifier needs. They are the dependencies of the test and fuzzing tooling, and they are in the module graph because the test files are in the same module.
The practical consequences are two. First, the dependency graph of the library itself is tiny and mostly self-contained, which is why the library has few transitive requirements to audit. Second, anyone vendoring this module gets the tooling dependencies too, because Go does not separate test-only dependencies from library ones at the module level.
The API stability promise has one exception already spent in it
There is a short section on API stability, and it is written by someone who has thought about what a promise means.
The opening is a refusal of an absolute guarantee: there is no guarantee for absolute stability. Then the substance. Issues and bugs are taken seriously, API changes are not taken lightly, and the library will be maintained in a compatible way unless a serious defect prevents that.
Then the exception, stated plainly. There has been one API change after version 1, which added options support, and the author took the opportunity to push through some further cleanup at the same time. And there are no plans whatsoever for future API changes.
So the guarantee is not that the API is frozen. It is that version 1 to version 2 already spent the budget, and any future change would have to be forced by a serious bug rather than a preference. That is a stronger and more useful statement than a semantic version number, because it tells you the author has a policy rather than a version counter.
It also tells you where to look first if something breaks: the release history, not the version number. With no tags to compare and a module path that already carries a major version, the history is the compatibility record.
Testing is full coverage plus fuzzing, with the bugs listed on a wiki
The testing section states two policies rather than describing a suite.
The first is that 100 percent test coverage is pursued, and the scope is specific: every subpackage plus the imported parsing package. That last part is a commitment about someone else's module, which means the coverage number depends on a dependency the project also writes.
The second is fuzz testing, run with a fuzzing framework and hosted in a separate repository, linked from the readme. There is a separate link to a wiki page described as holding the most important bugs found by fuzz testing.
Publishing your fuzzing findings on a wiki is the detail that makes this worth reading. Fuzzing a parser finds crashes on malformed input, and for a library whose job is to accept whatever a browser or a client sends, those crashes are the security-relevant failures. Listing the notable ones turns a private quality process into something a user can check.
It also reframes what a minifier's risk actually is. The output correctness is the obvious concern, but the input side is where a parser written in a memory-safe language can still fail badly, on deeply nested markup or on an input that exhausts a stack. That is the class of bug the wiki page documents.
The prologue is an argument against regex minifiers, with a speed claim attached
The readme opens its argument with a survey of other minifiers, and it is worth reading because it tells you what this project thinks it is competing with.
The claim is that minifiers exist in almost every programming language, and that many are merely a set of regular expressions trimming whitespace and comments. The readme links a well known article arguing that using regular expressions to parse HTML or XML is ill-advised. Other implementations are described as more profound, naming the YUI Compressor and Google's Closure Compiler for JavaScript.
Then the diagnosis: most existing implementations either use JavaScript, or use regular expressions, or do not focus on performance, so they are slow. The project's own claim follows, that it is usually orders of magnitude faster than existing minifiers.
The speed claim is attributed. The readme points at a third-party benchmark repository and says this library is one of the fastest JavaScript minifiers there, and the table of contents has a comparison section for compression ratio and for time. So the claim is checkable rather than asserted, which is the difference between a benchmark reference and a boast.
One more thing in that first screen is easy to miss and worth a note: the readme states that the shortest valid piece of HTML5 is a doctype declaration followed by a title element, and links the W3C validator so you can check it. That is the project's own minifier output rendered back to the shortest form.
Editorial conclusion
minify fits a Go service that has to shrink HTML, CSS, JavaScript, JSON, SVG or XML on the fly, including the CSS and JavaScript embedded inside an HTML response, and that would rather not shell out to a Node toolchain. It does not fit someone who needs source maps, who needs a bundler, or who is minifying SVG at volume, because all three are open roadmap items rather than features. Before you depend on it, check the Go version against your own toolchain rather than the readme's number, read the API stability paragraph rather than assuming semver, and if you are reaching for the .NET or Python binding, remember the .NET port lives in someone else's repository and will move on its own schedule.
Frequently asked questions
What does minify do, and which formats does it cover?
It removes bytes from a file without changing its output, which shrinks the file and speeds up transmission and parsing. It provides HTML5, CSS3, JS, JSON, SVG and XML minifiers plus an interface for implementing others, and it associates mimetypes with minification functions so CSS or JavaScript embedded inside an HTML file is minified as well.
How do I install minify in Go?
You need Git and Go. The readme says Go 1.18 or higher while the module manifest declares 1.25.0, so check the manifest against your toolchain. Create a module with go mod init, fetch it with go get using the version 2 module path, then import the top-level package plus one package per format you need.
How do I minify JSON, CSS and HTML with this library?
Import the package for each format alongside the top-level package, then use the documented function families for constructing a minifier and for reading from a reader, bytes or a string and writing to a reader or a writer. There is also HTTP middleware for a server, and a way to register your own minifier against a mimetype or a pattern.
Is the SVG minifier in minify fast?
Not according to the project's own roadmap, which lists speeding up the SVG minifier as an open item and describes it as very slow. Other open items are using assembly and SIMD for the core parsers and generating source maps, the latter marked uncertain. Completed items include parser error reporting with line and column information and variable shortening in the JS minifiers.
Can minify be used outside a Go program?
Yes. There are command line binaries for various platforms on the repository's releases, an online demo, a Docker image, a Windows package installable with scoop, Python bindings on PyPI, JavaScript bindings on npm, and .NET bindings that live in a separate repository. The library can also redirect to an external minifier such as Closure Compiler, UglifyCSS, UglifyJS or esbuild.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/tdewolff-minify)Star history chart for your README
[](https://hysenlabs.com/projects/tdewolff-minify)Was this useful?