Replace Jquery with Cash

GitHub - fabiospampinato/cash: An absurdly small jQuery alternative for modern browsers.
An absurdly small jQuery alternative for modern browsers. - GitHub - fabiospampinato/cash: An absurdly small jQuery alternative for modern browsers.

Cash is a tiny little plugin that uses a lot of Jquery syntax and allows you to continue to write your JS with a very comfortable and familiar syntax.

<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/8.1.0/cash.min.js"></script>
<script>
  $(function () {
    $('html').addClass ( 'dom-loaded' );
    $('<footer>Appended with Cash</footer>').appendTo ( document.body );
  });
</script>

If you are doing some small little dom manipulations why not reach for Cash.

If you are watching your KB as you optimize for Core Web Vitals, Cash is something that might be worth reaching for depending on how you use Jquery. According to their Readme, the total file size Minified & Gzipped is only 6kb. The default install doesn't do everything Jquery full will do so make sure this works for your projects before you make a move.

Subscribe to Stack Snacks

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe