explaingit

fabiospampinato/cash

7,040JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A tiny, modern JavaScript library with jQuery-style syntax for selecting and manipulating webpage elements, at just 6KB compressed compared to jQuery's 24KB, targeting modern browsers only.

Mindmap

mindmap
  root((cash))
    What It Does
      jQuery-style API
      DOM manipulation
      Event handling
    Size Advantage
      6KB compressed
      vs 24KB jQuery
      Modern browsers only
    Features
      CSS selectors
      Attribute read write
      Form handling
      Element insertion
    Tech Stack
      JavaScript
      TypeScript
      npm or CDN
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Replace jQuery in a website project with a 6KB alternative that uses the same familiar dollar-sign syntax.

USE CASE 2

Select and modify HTML elements, handle events, and change CSS styles without loading jQuery.

USE CASE 3

Build a partial bundle including only the Cash methods your project actually needs to reduce file size further.

USE CASE 4

Migrate an existing jQuery project to Cash using the provided migration guide.

Tech stack

JavaScriptTypeScriptnpm

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

Cash is a small JavaScript library that lets developers interact with webpage elements using the same style of code that jQuery popularized. jQuery became famous for simplifying how developers select and modify HTML elements on a page, but it grew large over time. Cash offers the same familiar syntax at a fraction of the file size, targeting modern browsers rather than very old ones. The size difference is meaningful. Cash comes in at 6 kilobytes when compressed and delivered over the web, compared to 24.4 kilobytes for a slimmed-down version of jQuery. This matters because every kilobyte a browser has to download adds a small delay before a page becomes interactive, and smaller files mean faster loads for visitors. The library supports selecting page elements by CSS selectors, chaining operations together, handling browser events, reading and writing HTML attributes, getting and setting CSS styles, manipulating the page structure by adding, removing, or moving elements, and working with forms. Most of the common day-to-day tasks that developers reach for jQuery to handle are covered here. Cash is written in TypeScript, which means its type definitions are generated directly from the source code rather than maintained separately by volunteers in a third-party registry. It also supports partial builds, where you can include only the specific methods your project actually uses to reduce the file size further. The library can be loaded from a content delivery network with a single script tag, or installed as a package through npm for use in bundled JavaScript projects. If you are already using jQuery and want to switch, the project provides a migration guide to help identify what is and is not available in Cash.

Copy-paste prompts

Prompt 1
Show me how to select all elements with class 'active' and hide them using Cash, the same way I would with jQuery.
Prompt 2
How do I add a click event listener to a button and remove it later using Cash's on() and off() methods?
Prompt 3
Give me a Cash code snippet to read the current value of a form input and update a paragraph's text with it.
Prompt 4
How do I install Cash via npm and import only the specific methods I need for a bundled JavaScript project?
Prompt 5
What jQuery features are missing from Cash that I need to watch out for when migrating my project?
Open on GitHub → Explain another repo

← fabiospampinato on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.