Skip to content

Commit 2069129

Browse files
Improved readme
1 parent 12b232d commit 2069129

6 files changed

Lines changed: 37 additions & 121 deletions

File tree

README.md

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,24 @@
55

66
# Cash
77

8-
*An absurdly small jQuery alternative for modern browsers (IE10+)*
9-
10-
Cash is a small library for modern browsers (IE10+) 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.
8+
Cash is an absurdly small jQuery alternative for modern browsers (IE10+) 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.
119

1210
## Size Comparison
1311

1412
| | Cash | jQuery 3.3.1 |
1513
| ------------------ | ----------- | ------------ |
1614
| Uncompressed | **28.7 KB** | 271 KB |
1715
| Minified | **11 KB** | 87 KB |
18-
| Minified & Gzipped | **4.4 KB** | 30.3 KB |
19-
20-
An **85%** gain in size reduction. If you need a smaller file, partial builds are supported too since this project is bundled using [pacco](https://github.com/fabiospampinato/pacco).
21-
22-
#### Partial Builds
23-
24-
Some alternative configuration files for [pacco](https://github.com/fabiospampinato/pacco) for generating partial builds are available [here](https://github.com/kenwheeler/cash/tree/master/resources/pacco).
16+
| Minified & Gzipped | **4.5 KB** | 30.3 KB |
2517

26-
Let's compare the size of those partial builds (you could actually exclude individual methods and get even smaller builds):
27-
28-
| Enabled Modules | Minified | Minified & Gzipped |
29-
| ------------------------------------------- | -------- | ------------------ |
30-
| <abbr title="Query Selector All">QSA</abbr> | 1.1 KB | **0.6 KB** |
31-
| attributes | 2.8 KB | **1.2 KB** |
32-
| events | 3.5 KB | **1.5 KB** |
33-
| collection + manipulation + traversal | 5.3 KB | **1.9 KB** |
18+
An **85%** gain in size reduction. If you need a smaller bundle, we support [partial builds](https://github.com/kenwheeler/cash/blob/master/docs/partial_builds.md) too.
3419

3520
## Usage
3621

37-
Get cash from [CloudFlare](https://cdnjs.cloudflare.com/ajax/libs/cash/2.1.3/cash.min.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/cash-dom@2.1.3/dist/cash.min.js) and use it like this:
22+
Get cash from [CloudFlare](https://cdnjs.cloudflare.com/ajax/libs/cash/2.3.2/cash.min.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/cash-dom@2.3.2/dist/cash.min.js) and use it like this:
3823

3924
```html
40-
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/2.1.3/cash.min.js"></script>
25+
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/2.3.2/cash.min.js"></script>
4126
<script>
4227
$(function () {
4328
$('html').addClass ( 'dom-loaded' );
@@ -47,12 +32,15 @@ Get cash from [CloudFlare](https://cdnjs.cloudflare.com/ajax/libs/cash/2.1.3/cas
4732
```
4833

4934
Cash is also available through [NPM](http://npmjs.com) as the [`cash-dom`](https://www.npmjs.com/package/cash-dom) package:
50-
```
35+
36+
```sh
5137
npm install cash-dom --save-dev
5238
```
5339

5440
## Documentation
5541

42+
Cash gives you a query selector, [collection methods](#collection-methods) and some [library methods](#cash-methods). If you need more details about our API just check out [jQuery's](http://api.jquery.com), while we don't implement everything that jQuery provides, everything what we do implement should be compatible with jQuery.
43+
5644
### $()
5745

5846
This is the main selector method for cash. It returns an actionable collection of nodes.

docs/partial_builds.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
# Partial Builds
3+
4+
Cash is bundled using [pacco](https://github.com/fabiospampinato/pacco), therefore it supports partial builds out of the box.
5+
6+
In order to make a custom build you'll have to use a custom configuration for pacco, the [default one](https://github.com/kenwheeler/cash/blob/master/pacco.json) includes everything.
7+
8+
Some alternative configuration files are available [here](https://github.com/kenwheeler/cash/tree/master/resources/pacco).
9+
10+
## Size Comparison
11+
12+
Let's compare the size of those partial builds (you could actually exclude individual methods and get even smaller builds):
13+
14+
| Enabled Modules | Minified | Minified & Gzipped |
15+
| ------------------------------------------- | -------- | ------------------ |
16+
| <abbr title="Query Selector All">QSA</abbr> | 1.1 KB | **0.6 KB** |
17+
| attributes | 2.8 KB | **1.2 KB** |
18+
| events | 3.5 KB | **1.5 KB** |
19+
| collection + manipulation + traversal | 5.3 KB | **1.9 KB** |
20+
21+
## Usage
22+
23+
Replace the content of `pacco.json` with your custom configuration, then run:
24+
25+
```sh
26+
npm install
27+
npm run build:deploy
28+
```

resources/pacco/attributes.json

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,5 @@
2222
"minified": "[dist]/[bundle].min.js"
2323
}
2424
}
25-
},
26-
"plugins": {
27-
"wrapper": {
28-
"options": {
29-
"templates": {
30-
"default": "/* MIT https://github.com/kenwheeler/cash */\n(function(){\n[content]\n})();"
31-
}
32-
}
33-
}
34-
},
35-
"environments": {
36-
"production": {
37-
"plugins": {
38-
"uglify": {
39-
"enabled": false
40-
},
41-
"closure": {
42-
"enabled": true,
43-
"options": {
44-
"outputWrapper": "",
45-
"compilationLevel": "SIMPLE"
46-
}
47-
}
48-
}
49-
}
5025
}
5126
}

resources/pacco/collection_manipulation_traversal.json

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,5 @@
2222
"minified": "[dist]/[bundle].min.js"
2323
}
2424
}
25-
},
26-
"plugins": {
27-
"wrapper": {
28-
"options": {
29-
"templates": {
30-
"default": "/* MIT https://github.com/kenwheeler/cash */\n(function(){\n[content]\n})();"
31-
}
32-
}
33-
}
34-
},
35-
"environments": {
36-
"production": {
37-
"plugins": {
38-
"uglify": {
39-
"enabled": false
40-
},
41-
"closure": {
42-
"enabled": true,
43-
"options": {
44-
"outputWrapper": "",
45-
"compilationLevel": "SIMPLE"
46-
}
47-
}
48-
}
49-
}
5025
}
5126
}

resources/pacco/events.json

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,5 @@
2222
"minified": "[dist]/[bundle].min.js"
2323
}
2424
}
25-
},
26-
"plugins": {
27-
"wrapper": {
28-
"options": {
29-
"templates": {
30-
"default": "/* MIT https://github.com/kenwheeler/cash */\n(function(){\n[content]\n})();"
31-
}
32-
}
33-
}
34-
},
35-
"environments": {
36-
"production": {
37-
"plugins": {
38-
"uglify": {
39-
"enabled": false
40-
},
41-
"closure": {
42-
"enabled": true,
43-
"options": {
44-
"outputWrapper": "",
45-
"compilationLevel": "SIMPLE"
46-
}
47-
}
48-
}
49-
}
5025
}
5126
}

resources/pacco/qsa.json

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,5 @@
3232
"minified": "[dist]/[bundle].min.js"
3333
}
3434
}
35-
},
36-
"plugins": {
37-
"wrapper": {
38-
"options": {
39-
"templates": {
40-
"default": "/* MIT https://github.com/kenwheeler/cash */\n(function(){\n[content]\n})();"
41-
}
42-
}
43-
}
44-
},
45-
"environments": {
46-
"production": {
47-
"plugins": {
48-
"uglify": {
49-
"enabled": false
50-
},
51-
"closure": {
52-
"enabled": true,
53-
"options": {
54-
"outputWrapper": "",
55-
"compilationLevel": "SIMPLE"
56-
}
57-
}
58-
}
59-
}
6035
}
6136
}

0 commit comments

Comments
 (0)