SSJX.CO.UK
Content

JavaScript Optimiser

Improve load times, save costs and find potential JavaScript problems with this useful command line tool!

Reduce File Size

This tools reduces the size of your JavaScript file by doing the following:

Health Check

As well as making the file smaller, the tool also checks for possible problems and suggests improvements:

Usage

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!

Downloads

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/.