// the find
douglascrockford/JSMin
JavaScript Minification Filter
A single-file C program (one .c file, ~500 lines) that strips comments and non-essential whitespace from JavaScript via stdin/stdout, written by Douglas Crockford. It's for people who want to see how a hand-rolled tokenizer-based minifier works, or who need a zero-dependency filter to drop into an old shell-based build pipeline.
The whitespace/newline-omission rules are genuinely careful — it tracks whether linefeeds act as implicit semicolons and won't touch anything inside string or regex literals, which is the part naive minifiers get wrong. Being a pure stdin/stdout filter with no dependencies means it composes trivially with any Unix pipeline or Makefile, and the source is small enough to audit in one sitting.
The whitespace/linefeed rules were designed for ES3/ES5-era syntax and predate template literals, arrow functions, and destructuring, so there's real risk it mishandles modern syntax rather than just under-minifying it. There's a compiled jsmin.exe checked into the repo root alongside the source — no build reproducibility, no CI, and a binary in version control is a supply-chain smell. There's also no test suite, just README examples, so correctness on edge cases (nested comments, weird regex literals) is unverified. Functionally it's been frozen since 2013 and offers no dead-code elimination, no source maps, and no tree-shaking — terser or esbuild do everything this does and far more.