HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
tdewolff
minify
Go2016–2022
tdewolff / minify

minify

Go minifiers for web formats

8Distinct people
8Mentions
0Explicit recommenders
4.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Go minifiers for web formats

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:03:16 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year8 dated mentions

Observed mentions: 2016-11-26 15:24:18 UTC to 2022-09-28 22:05:58 UTC.

01232016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 2 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2022

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC110
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC321
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC312

What Hacker News says

8 sources
cududa·Sep 28, 2022Submission

Tell HN: Toptal's HTML minification API occasionally injects tracking JavaScript

Just a heads up for anyone using their API - about 1 in 5 requests will return with Cloudflare Insights tracking JS. It's not mentioned anywhere in the API documentation, Privacy Policy, or ToS. Fairly certain this is the package they based their service on https://github.com/tdewolff/minify Edit: Here's a tweet I posted with a screenshot of the code: https://twitter.com/cullend/status/1575243757624360960?s=20&t=JVhqXDJExBnrEVOXeFH4Jg
97 points · Open discussion
> In recent years, a few mavericks and renegades have started to turn away from the world of JS frameworks and the inevitable bloated node_modules folders Some projects claim they are "zero dependencies" but a few sentences into the readme and you see an `npm install` and now you notice there is `package.json` after all . They meant zero runtime dependencies, which is still praiseworthy, but not zero `devDependencies`. For my greenfield web app, I attempted to have zero dev dependencies on Node. I wrote some vanilla HTML, JS, CSS, and now needed to reduce network transfer. Requirements: - minify - inlining CSS file into HTML - compress with Brotli - print out final byte size - nice to have: run a dev server that serves static Brotli We know the story with WebPack. I looked to Parcel instead because it's the "zero-config" tool. It was prom
Read the rest
ising because it inlined my `@import css` into my HTML, and logged out the filesize. The watch and reload feature wasn't working as promised, but that was nice to have anyways. For Brotli compression, which is mainstream at this point, I quickly needed to add a `.parcelrc` config. Their code sample didn't work because it turns out that in the real world you need to make your .parcelrc extend/inherit "@parcel/config-default". Parcel stopped logging at the compressed file sizes and not the final Brotli file sizes. Finally, Parcel's dev server is useless to me because you can't set encoding headers for "Brotli" files so the browser just attempts to download it. I didn't have a .gitignore file, and adding this one Node dependency on Parcel added 3,000 new files. To be fair, that's miniscule for a Node project. I asked myself if I can achieve the same results with CLI tools that are not Node. I first looked to the Golang ecosystem. I stumbled upon https://github.com/tdewolff/minify. It just does minification. It's comparable in output size to other Node minifiers, but faster and just works. The lexer code is very readable, even for me who is not a compiler or systems expert. It's one command to install the CLI, and one command to Minify. You can do `npm install global -g` to get CLIs, but Node supply chains tend to be much deeper. This bespoke one-liner does the CSS inlining for me: RUN sed -i "s/@import \"style.css\"/$(cat style.css)/g" index.html` For Brotli compression, I went with the official first party CLI ( also Go based ) instead of using a third-party wrapper like you'd have to do with JavaScript. One thing I was missing in NPM scripts as a self-documenting way of describing what commands to build, run, test. I've seen cases where people are beholden to a `package.json`, sometimes when their project doesn't even involve JavaScript. When you have a hammer, everything looks like a nail. It turns out Makefiles are a better way of doing this, especially if you don't already have a active relationship with Node .PHONY: help help: ## This help. @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) # DOCKER TASKS build: ## Build the container podman build -t ${APP_NAME} . run: ## Run container on port configured in `config.env` podman run -it --rm -d --env-file=./config.env - p=$(HOST_PORT):80 --name="$(APP_NAME)" It's even better than self-documentation, because the documentation is self-documenting: $ make help help This help. build Build the container run Run container on port configured in `config.env`
In Reimagining front-end web development with htmx and hyperscript
Usually I'll just search online and read man pages (and experiment different options and solutions) but here's a short list of my most used aliases and functions, I guess that's the closest thing I have to a cheatsheet alias private='shopt -uo history' alias unprivate='shopt -so history' alias gl="git log --all --decorate --oneline --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'" alias gitlog='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit --date=relative --branches' alias sha256sum="shasum -a 256" alias sha512sum="shasum -a 512" alias flushDNSMac="sudo killall -HUP mDNSResponder" alias myip="dig +short myip.opendns.com @resolver1.opendns.com" alias m1="arch -arm64" alias x86
Read the rest
="arch -x86_64" alias ibrew='arch -x86_64 /usr/local/bin/brew' alias upgrade="ibrew upgrade && m1 brew upgrade && mas upgrade" alias docker-clean='docker ps -aq | xargs -P $(nproc) -n1 docker rm -f ; docker rmi -f $(docker images --filter "dangling=true" -q --no-trunc)' alias autoscalerstatus="kubectl describe -n kube-system configmap cluster-autoscaler-status" alias evictedpods="kubectl get pods --all-namespaces --field-selector=status.phase=Failed" 2qr() { qrencode "$1" -t ANSI256 -o - } curl_status() { if [ -n "${1}" ]; then curl -L -o /dev/null --silent --head --write-out '%{http_code}\n' "$1" fi } webp_convert() { local file="$1" cwebp -q 100 "$file" -o "${file%.\*}.webp" } To minify everything (using https://github.com/tdewolff/minify) find ./dist/ -type f \( \ -name "*.html" \ -o -name '*.js' \ -o -name '*.css' \ -o -name '*.svg' \ -o -name "*.xml" \ -o -name "*.json" \ -o -name "*.htm" \ \) \ -and ! -name "*.min\*" -print0 | xargs -0 -n1 -P4 -I '{}' sh -c 'minify -o "{}" "{}"'
In Ask HN: Can I see your cheatsheet?

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.