<commit_before># proxify-url
A YQL wrapper used to generate a proxy URL to a given resource.<commit_msg>Adding a first documentation of the library<commit_after>![Logo](https://s.yimg.com/lq/i/us/pps/yql128.gif)

# proxify-url

A YQL wrapper used to generate a proxy URL to a given resource.

Current version: **1.0.4**

Lead Maintainer: [<NAME>](mailto:<EMAIL>)

## Install

##### Using NPM

```bash
npm install --save proxify-url
```

##### Using Bower

```bash
bower install --save proxify-url
```

## Description

This small component aims to make it possible to issue AJAX requests to third-party resources when it is not possible in normal cases, because of [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) or because the remote service does not support [JSONP](https://en.wikipedia.org/wiki/JSONP) for instance.

The library will generate an URL pointing to the initial resource, but instead of having the browser directly request the remote server for the resource, it will request the Yahoo Query Language API to act as a middle man since it supports `CORS` and `JSONP`.

## Usage

### Proxify an url

Simply require the `proxify-url` according to the environment you are in (Node.js, AMD and the browser are supported), and call the returned function with the given URL. An example in the browser would be as follow :

```javascript
var url = proxify('http://foo.bar/');
```
{'fraction_non_alphanumeric': 0.10121168923734854, 'fraction_numerical': 0.0042765502494654314, 'mean_word_length': 4.484375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 3, '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': '842198', 'n_tokens_mistral': 421, 'n_tokens_neox': 395, 'n_words': 183}