I was doing a little offline dev work over the weekend and needed to minify one of my js files. Usually I would just go to a website like jscompress, but like I said, I was working offline. So I decided to write a little shell script! (I love shell scripts)
I’m essentially taking advantage of the trim command like this:
cat jsfile.js | tr "\n" " " | tr -d " " > jsfile.min.js
The full code as well as instructions can be found on my Github.