<commit_before># cb-fetch

A truly **c**ross-**b**rowser and forward-compatible library to do asynchronous HTTP requests that follows the **c**all**b**ack pattern.

## Table of Contents
  - [Installation](#installation)
    - [NPM](#npm)
    - [JSPM](#jspm)
  - [Examples](#examples)
  - [API](#api)
  - [Features](#features)
  - [License](#license)

## Installation
###NPM
```sh
npm install --save cb-fetch
```
###JSPM
```sh
jspm install cb-fetch=npm:cb-fetch
```
## Examples
```js
var request = require('cb-fetch');

// this looks too easy
request()
  .get('http://www.example.com?key1=value1&key2=value2')
  .done(onSuccessCallback);

// chain those methods!
request()
  .get('http://www.example.com')
  .query('key1=value1&key2=value2')
  .done(onSuccessCallback);
  
// is it explicit enough?
request({
          url:        'http://www.example.com',
          parameters: new URLSearchParams('key1=value1&key2=value2'),
          method:     'get',
          headers:    {},
          credentials:'same-origin',
          etc:        '…'
        }).done(onSuccessCallback, onFailCallback);
```
## API
```
interface Options {
  body: FormData | String,
  credentials = 'same-origin': 'include' | 'omit' | 'same-origin',
  headers: Headers | Object,
  mediaType: String,
  method = 'GET': /GET|HEAD|DELETE|POST|PUT|PATCH/i,
  mode = 'same-origin': 'cors' | 'no-cors' | 'same-origin',
  parameters: URLSearchParams | Object | String,
  responseType: 'text' | 'json' | 'blob' | 'document' | 'arraybuffer' | 'formdata',
  timeout: ℕ,
  url = location.href: String
}
```<commit_msg>missing anchors<commit_after># cb-fetch

A truly **c**ross-**b**rowser and forward-compatible library to do asynchronous HTTP requests that follows the **c**all**b**ack pattern.

## Table of Contents
  - [Installation](#installation)
    - [NPM](#npm)
    - [JSPM](#jspm)
  - [Examples](#examples)
  - [API](#api)
  - [Features](#features)
  - [License](#license)

## Installation
###NPM
```sh
npm install --save cb-fetch
```
###JSPM
```sh
jspm install cb-fetch=npm:cb-fetch
```
## Examples
```js
var request = require('cb-fetch');

// this looks too easy
request()
  .get('http://www.example.com?key1=value1&key2=value2')
  .done(onSuccessCallback);

// chain those methods!
request()
  .get('http://www.example.com')
  .query('key1=value1&key2=value2')
  .done(onSuccessCallback);
  
// is it explicit enough?
request({
          url:        'http://www.example.com',
          parameters: new URLSearchParams('key1=value1&key2=value2'),
          method:     'get',
          headers:    {},
          credentials:'same-origin',
          etc:        '…'
        }).done(onSuccessCallback, onFailCallback);
```
## API
```
interface Options {
  body: FormData | String,
  credentials = 'same-origin': 'include' | 'omit' | 'same-origin',
  headers: Headers | Object,
  mediaType: String,
  method = 'GET': /^(delete|get|head|patch|post|put)$/i,
  mode = 'same-origin': 'cors' | 'no-cors' | 'same-origin',
  parameters: URLSearchParams | Object | String,
  responseType: 'text' | 'json' | 'blob' | 'document' | 'arraybuffer' | 'formdata',
  timeout: ℕ,
  url = location.href: String
}
```
{'fraction_non_alphanumeric': 0.18738170347003155, 'fraction_numerical': 0.007570977917981073, 'mean_word_length': 3.5042613636363638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '2288763', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1066, 'n_words': 235}