The smallest Javascript libraries on the internet ... Popular Javascript libraries such as

To reduce bandwidth requirements, these libraries are usually minified and GZIP compressed.

Surprisingly, most Content Delivery Networks (CDNs) give you a quite bad level of GZIP compression.



Google's

It produces files fully compatible to the DEFLATE algorithm (used by GZIP) but in order to find even better compression

it is based on a random walk (trial-'n'-error). I run a brute-force search to find optimal Zopfli parameters.



That means: when decompressed by the browser, my files are 100% identical to the original minified versions.

There is no difference to the developer, to the administrator or to the end-user:

except my files are smaller and therefore load a tiny bit faster.

size(mine) < size(original) but content(mine) = content(original)



Everything you find on the website can be used in in non-commercial as well as commercial projects without any obligations

However, if you are a super-kind person, then please send me a short mail. Or a postcard. Or both.

Popular Javascript libraries such as jQuery grew tremendously over the years.To reduce bandwidth requirements, these libraries are usually minified and GZIP compressed.Surprisingly, most Content Delivery Networks (CDNs) give you a quiteof GZIP compression.Google's Zopfli (open source) is currently the best GZIP compressor and produces the smallest files.It produces files fully compatible to the DEFLATE algorithm (used by GZIP) but in order to find even better compressionit is based on a random walk (). I run a brute-force search to find optimal Zopfli parameters.Everything you find on the website can be used in in non-commercial as well as commercial projects without any obligationsHowever, if you are a super-kind person, then please send me a short mail. Or a postcard. Or both.

How To Use It Select your desired library from the table above, for example download the smallest file and store it on your server e.g. https://minime.stephan-brumme.com/files/jquery/jquery-3.5.1.min.js.gz

speed and availability only limited by your super-expensive hosting plan

you must take care of visitors with outdated browsers without GZIP support

hotlink to my server's copy e.g. https://minime.stephan-brumme.com/files/jquery/jquery-3.5.1.min.js

always the smallest file

visitors with outdated browsers will automatically receive the uncompressed version

probably much slower than your super flashy server (however, I implemented ETag caching support) As mentioned before, after decompression my files are 100% identical to their original version.

The only difference is I spent much more time finding an (almost) optimal compression. Select your desired library from the table above, for example jQuery 3.5.1 , and either:As mentioned before, after decompression my files areto their original version.The only difference is I spent much more time finding an (almost) optimal compression.

Fallback Solution No matter which CDN you use, it's always a good idea to have a fallback in case the CDN is unreachable or - even worse - delisted your specific library.

All you have to do is to keep a copy of that library on your local server and add the following Javascript code:

<script src= http://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"



<script>window.jQuery || document.write( '<script src="local_server_path/jquery.min.js">\\x3C/script>' )</script>

window.jQuery || document.write()

Please be aware that window.jQuery (last line) is specific to jQuery, for other libraries you have to use their dedicated main Javascript object:

Library Load Local Fallback AngularJS <script>window.angular || document.write( '<script src="local_server_path/angular.min.js">\x3C/script>' )</script> BackboneJS <script>window.Backbone || document.write( '<script src="local_server_path/backbone.min.js">\x3C/script>' )</script> Bootstrap <script>$.fn.modal || document.write( '<script src="local_server_path/bootstrap.min.js">\x3C/script>' )</script> D3 <script>window.d3 || document.write( '<script src="local_server_path/d3.min.js">\x3C/script>' )</script> Dojo <script>typeof(dojo) !== "undefined" || document.write( '<script src="local_server_path/dojo.min.js">\x3C/script>' )</script> Ember <script>window.Ember || document.write( '<script src="local_server_path/ember.min.js">\x3C/script>' )</script> jQuery <script>window.jQuery || document.write( '<script src="local_server_path/jquery.min.js">\x3C/script>' )</script> Knockout <script>window.ko || document.write( '<script src="local_server_path/knockout.min.js">\x3C/script>' )</script> lodash <script>window._ || document.write( '<script src="local_server_path/lodash.min.js">\x3C/script>' )</script> React <script>window.React || document.write( '<script src="local_server_path/react.min.js">\x3C/script>' )</script> ThreeJS <script>window.THREE || document.write( '<script src="local_server_path/three.min.js">\x3C/script>' )</script> UnderscoreJS <script>window._ || document.write( '<script src="local_server_path/underscore.min.js">\x3C/script>' )</script>

You can try another CDN instead of falling back to your local server, too. No matter which CDN you use, it's always a good idea to have a fallback in case the CDN is unreachable or - even worse - delisted your specific library.All you have to do is to keep a copy of that library on your local server and add the following Javascript code:Please be aware that(last line) is specific to jQuery, for other libraries you have to use their dedicated main Javascript object:You can try another CDN instead of falling back to your local server, too.

Info I created this website as a hobby project because every time a byte is wasted, a kitten cries. Seriously ;-)



By the way: if you run a small website it's totally fine to hotlink to the compressed files on my server.

However, high-traffic websites should copy my files to their own server.

And in the best of all worlds, major CDNs would replace their (too) large versions ... well, I'm just dreaming.