<commit_before># cookies

>Javascript library for accessing and manipulating HTTP cookies in the web browser. Get one or a list of cookies, set cookies, delete cookies, test if the browser accepts cookies. When JSON support is available, any JS value can be set to a cookie--it will be automatically serialized before being written, and un-serialzied on read.

[![GitHub version](https://badge.fury.io/gh/JAAulde%2Fcookies.png)](http://badge.fury.io/gh/JAAulde%2Fcookies)
[![Bower version](https://badge.fury.io/bo/jaaulde-cookies.png)](http://badge.fury.io/bo/jaaulde-cookies)
[![NPM version](https://badge.fury.io/js/jaaulde-cookies.png)](http://badge.fury.io/js/jaaulde-cookies)

## installation
### html
````html
<script src="/path/to/jaaulde-cookies.js"></script>
````

### bower
````bash
bower install jaaulde-cookies
````

### npm
````bash
npm install jaaulde-cookies
````

## usage
This library is intended for use in the browser to access and manipulate cookies. It provides a singleton API, `cookies`, in the global namespace (`window`).

### Test for browser cookie acceptance
````javascript
var accepting_cookies = cookies.test(); // returns boolean
````

### Set cookies
````javascript
// sets cookie by the name of 'myCookie' to value of 'myValue' with default options
cookies.set('myCookie', 'myValue');

// sets cookie by the name of 'myCookie' to value of 'myValue' with path of '/somedir'
cookies.set('myCookie', 'myValue', {path: '/somedir'});
````<commit_msg>continuing documentation<commit_after># cookies

>Javascript library for accessing and manipulating HTTP cookies in the web browser. Get one or a list of cookies, set cookies, delete cookies, test if the browser accepts cookies. When JSON support is available, any JS value can be set to a cookie--it will be automatically serialized before being written, and un-serialzied on read.

[![GitHub version](https://badge.fury.io/gh/JAAulde%2Fcookies.png)](http://badge.fury.io/gh/JAAulde%2Fcookies)
[![Bower version](https://badge.fury.io/bo/jaaulde-cookies.png)](http://badge.fury.io/bo/jaaulde-cookies)
[![NPM version](https://badge.fury.io/js/jaaulde-cookies.png)](http://badge.fury.io/js/jaaulde-cookies)

## installation
### html
````html
<script src="/path/to/jaaulde-cookies.js"></script>
````

### bower
````bash
bower install jaaulde-cookies
````

### npm
````bash
npm install jaaulde-cookies
````

## usage
This library is intended for use in the browser to access and manipulate cookies. It provides a singleton API, `cookies`, in the global namespace (`window`).

### Test for browser cookie acceptance
````javascript
var accepting_cookies = cookies.test(); // returns boolean
````

### Set cookies
````javascript
// sets cookie by the name of 'myCookie' to value of 'myValue' with default options
cookies.set('myCookie', 'myValue');

// sets cookie by the name of 'myCookie' to value of 'myValue' with path of '/somedir'
cookies.set('myCookie', 'myValue', {path: '/somedir'});
````
### Get cookies
````javascript
// returns value of myCookie if it is present, null if not
cookies.get('myCookie');

// returns array containing value of each requested cookie if it is present, null if not
cookies.get(['myCookie', 'myOtherCookie']);

// returns array of all cookies from your site
cookies.get();
````

### Get filtered list of Cookies
````javascript
// returns list of cookies whose names start with "site"
cookies.filter( /^site/ );
````

### Delete Cookies
*(A cookie can only be deleted using the same options with which it was set)*
````javascript
// deletes a cookie, 'myCookie', with default options
cookies.del('myCookie');

// deletes a cookie by the name of 'myCookie' which had been set with a path of '/somedir'
cookies.del('myCookie', {path: '/somedir'});

// deletes all cookies
cookies.del(true);
````
{'fraction_non_alphanumeric': 0.1486450933964746, 'fraction_numerical': 0.0010523546435148646, 'mean_word_length': 4.876352395672334, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 6, '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': '3557831', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1168, 'n_words': 413}