<commit_before># Cart.js

Cart.js is a Javascript library that makes it easy to add dynamic cart features to Shopify themes.

It abstracts away some of the difficulties of working with Shopify's AJAX API (such as the limited nature of some of the
API endpoints and the need to make API calls synchronously) and provides a simple, consistent interface to manipulating
a customer's cart.

Beyond that, Cart.js provides some additional nifty functionality via two optional modules.


### Data API Module

Lets you use simple `data-*` markup attributes in your `.liquid` templates to manipulate the cart via AJAX.


### DOM Binding Module

Provides adapters, formatters and bindings for the excellent [Rivets.js](http://rivetsjs.com) DOM data-binding library,
allowing you to write HTML templates in your `.liquid` files that are re-rendered dynamically when the contents of your
cart change.


## Getting Started and Documentation

Documentation and examples are available on the [home page](http://cart-js.myshopify.com).

Cart.js currently depends on jQuery for its `$.ajax` and utility functions. This usually isn't a problem as most Shopify
themes ship with jQuery as a hard requirement.

Rivets.js is required if you want to use the DOM Binding module.<commit_msg>Minor updates to README.<commit_after># Cart.js

Cart.js is a Javascript library that makes it easy to add dynamic cart features to Shopify themes.

It abstracts away some of the difficulties of working with Shopify's AJAX API (such as the limited nature of some of the
API endpoints and the need to make API calls synchronously) and provides a simple, consistent interface to manipulating
a customer's cart.

Beyond that, Cart.js provides some additional nifty functionality via two optional modules:


### Data API Module

Lets you use simple `data-*` markup attributes in your `.liquid` templates to manipulate the cart via AJAX. This module
utilises jQuery's `.on()` event binder, and is off by default. Enable it by setting `dataAPI: true` when initialising
Cart.js.


### DOM Binding Module

Provides adapters, formatters and bindings for the excellent [Rivets.js](http://rivetsjs.com) DOM data-binding library,
allowing you to write HTML templates in your `.liquid` files that are re-rendered dynamically when the contents of your
cart change.

You don't need to set anything to enable this module - Cart.js will only initialise the DOM binding if the Rivets.js
library has been included on the page.


## Getting Started and Documentation

Documentation and examples are available on the [home page](http://cart-js.myshopify.com).


## Dependencies

Cart.js currently depends on [jQuery](http://jquery.com) for its AJAX helpers, custom event bindings and utility
methods. This usually isn't a problem as most Shopify themes ship with jQuery.

Rivets.js is required if you want to use the DOM Binding module.
{'fraction_non_alphanumeric': 0.05761888233252343, 'fraction_numerical': 0.0, 'mean_word_length': 4.521072796934866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3762637', 'n_tokens_mistral': 779, 'n_tokens_neox': 714, 'n_words': 415}