Skip to main content

Cash.js – A smaller jQuery Alternative

By October 7, 2014Blog

I recently came across a new JavaScript library that aims to provide all the main features of jQuery but at a smaller footprint. Coming in at only ~7.88Kb minified it does it nicely. Gzipped this file will be ~5Kb which is about the sixth the size of jQuery.

Although I love jQuery even the new jQuery 2.0 version trims the fat as long as you’re willing to stick with newer browsers. But if we still need some backwards compatibility and have a relatively simple website than a small library like cash.js can prove to be a good option.

You can take a look at the documentation at the home page on Github and you’ll see it provides all the common functions such as append, clone and ajax. It still follows the same jQuery syntax as well so even if you wanted to switch to jQuery at a later point you easily could swap the libraries with no problem.

I always keep in mind that the faster a site loads the better, so if we can use a smaller libraries, it’s sometimes a good idea, especially if they afford us the ability to move to something more advanced later on if we need to.