Skip to main content
drupalreleases
Release: Cms 2.2.3 — Update released for Drupal core (2.2.3)! Release: Libraries API 4.2.1 — Minor update available for module libraries (4.2.1). Release: Menu Link Attributes 8.x-1.10 — Minor update available for module menu_link_attributes (8.x-1.10). Release: Menu Link Attributes 8.x-1.9 — Minor update available for module menu_link_attributes (8.x-1.9). Release: Menu Item Extras 3.2.0 — Minor update available for module menu_item_extras (3.2.0). Release: Layout Paragraphs 2.1.4 — Minor update available for module layout_paragraphs (2.1.4). Release: PhotoSwipe - Responsive JavaScript Modal Image Gallery 5.0.11 — Minor update available for module photoswipe (5.0.11). Release: Search API attachments 10.0.13 — Minor update available for module search_api_attachments (10.0.13). Module Revived: Libraries API 4.2.0 — Module libraries updated after 11 months of inactivity (4.2.0). Security Coverage: Component Library — Module component_library now has official Drupal security advisory coverage.

Cash

Security covered Drupal 8–11
View on drupal.org

This module integrates Cash, a minimalist JavaScript library that offers jQuery-like syntax for DOM manipulation in modern browsers. It allows developers to use familiar chaining methods with a significantly smaller file size compared to jQuery.

Provides integration with Cash, an absurdly small jQuery alternative for modern browsers (IE9+).

Cash is a small library for modern browsers (Chrome, Firefox, Safari and Internet Explorer 9+) that provides jQuery style syntax for manipulating the DOM. Utilizing modern browser features to minimize the codebase, developers can use the familiar chainable methods at a fraction of the file size.
100% feature parity with jQuery isn't a goal, but cash comes helpfully close, covering most day to day use cases.

Library Cash jQuery 3.0 jQuery 2.2 Uncompressed 20K 263K 253K Minified 9.8K 86K 76K Minified & Gzipped 3.5K 34K 30K

If you need to support old browsers (IE8 below), Cash is not for you.

Requirements

Cash library:
Download Cash and extract it as is, rename cash-master to cash, so the
assets are at any:

  • /libraries/cash/dist/cash.min.js or
  • /libraries/cash-dom/dist/cash.min.js

Both paths are supported. The first is if downloaded directly from Github. The latter if using Composer via asset-packages and or via `npm-asset`. Or any path supported by core library finder or libraries.module.

Installation

Install the module as usual, more info can be found Installing Drupal module.

Related core issues

With the removal of jQuery from Core starting in Drupal 9, there are some discussions about DX and smaller alternatives to jQuery in Drupal core. Cash is one candidate, so we're tracking the issues here:

Please create an issue should you find further related core issues to link here.

Configuration

Visit the following to configure and make use of Cash:

/admin/config/media/cash

Migration guide from jQuery

If you're migrating from jQuery, be sure to read our migration guide.

Usage

The module doesn't do anything on its own by default.

Include it as needed using regular library attachments, e.g.:

$page['#attached']['library'][] = 'cash/cash';

Or use the provided UI for convenient at:

/admin/config/media/cash

Or use it as your own library dependency, recommended:

my_library:
  js:
    js/my_theme.min.js: {}
  dependencies:
    - cash/cash

Use it like `jQuery`, only now replace `jQuery` with `Cash`. Keep the `$` dollar sign as usual. No need to change it.

Who is this module for?

For anyone or modules working extensively with vanilla JavaScript rather than jQuery.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jul 2023
Latest release
2 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
2.0.x-dev Dev 11 Jul 10, 2026
1.0.2 Stable 8–11 Sep 13, 2024
1.0.1 Stable 8–10 Jul 23, 2023