How to minify and unminify JS

December 11, 2025

JS can be minified and unminified using the tool uglifyjs.

It's available on ubuntu distros. To minify simply run uglifyjs -c input.js > input.min.js

It can also be used as a reformatter of minified code using the -b option uglifyjs input.min.js -b -o output.js

It takes a while but both features come in handy at times.