Improve load times, save costs and find potential JavaScript problems with this useful command line tool!
This tools reduces the size of your JavaScript file by doing the following:
✂️ Comments are useful when working on a file but not needed in the published version.
✂️ As above, useful for debugging when making programs but not needed in published applications.
✂️ To save even more bytes!
💥 Multi-line declarations, where possible, are converted to a single line to save more bytes.
As well as making the file smaller, the tool also checks for possible problems and suggests improvements:
✔️ Not a common problem, but it checks for multiple functions with the same name.
✔️ Maybe subjective but tells you if you are not using 'strict mode' or if you are still using 'var' when it should be 'let/const'. Useful when updating old files.
As it was made more for my use than the public it is very simple, all you need to do is give it a file and it will produce a compressed version called 'compiled.js', e.g.:
>jsopt trak.js
JavaScript Optimiser v0.# Go (##/##/2026) by ssjx (https://ssjx.co.uk)
======================================================================
Input: trak.js
Output: compiled.js
JavaScript Health Check
-----------------------
* Missing 'use strict' at the top of file.
* 'var' found, consider using 'let' or 'const' instead.
* Duplicate function(s):
loadImages
The errors above were created to make sure the tool worked! The test file (trak.js) size went from 59KB to 38KB which is nearly a third off the size!
To create a different name output file, just add that onto the end of the command e.g.:
>jsopt trak.js newfile.js JavaScript Optimiser v0.# Go (##/##/2026) by ssjx (https://ssjx.co.uk) ====================================================================== Input: trak.js Output: newfile.js JavaScript Health Check ----------------------- No problems found!
⚠️ Please note that this tool is not perfect, and it will likely fail on complex or convoluted JavaScript files. As I use it more and more on my own work, it may get better over time so check back for updates!
This file archive was created with 7Zip. Newer versions of Windows 11 can now open these archives, if you need to download the tool, please visit https://www.7-zip.org/.
Download JavaScript Optimiser (444KB 7Zip)
Version 0.3 (13/01/2026)