<commit_before># gnar

A wrapper for the official [League of Legends API](https://developer.riotgames.com).

## Getting Started

1. obtain an API key from https://developer.riotgames.com by logging in with your League of Legends Account

2. install *gnar* as npm module (use `--save` to persist this to your package.json)

  ```bash
  npm install gnar
  ```

3. require *gnar* in your app

  ```javascript
  var gnar = require('gnar')('<your-api-key>', '<your region>');
  // you can change api-key and region later with
  //   gnar.configuration.setKey('<new-key>') and
  //   gnar.configuration.setRegion('<new-region>')
  ```

4. use *gnar* as you would expect

  ```javascript
  gnar.summoners.by_name('refridgerator').pipe(process.stdout)
  // all stream-based! pipe to what you need
  ```

5. as API requests are limited (to 10 per 10s, 500 per 10min by default) you may want to cache your results like

  ```javascript
  var cache = require('stream-cache'), fs = require('fs');
  // easiest way to cache (not fastest!): write to file system
  gnar.lol_static_data.champion.all().pipe(fs.createWriteStream('cache/champion.json'));
  // then retrieve it again
  var champion = fs.createReadStream('cache/champion.json');
  ```

## API documentation

As this is a pure wrapper for the League of Legends API, please refer the [full documentation](https://developer.riotgames.com/api/methods) for details on the API endpoints.

Method parameters (like `id`, `summonerId`) are parsed to strings (automatically by JavaScript) and inserted into the request url. Where the League of Legends API allows multiple entries (where the parameter is in plural, like `summonerIds`, `teamIds`) you can either pass a string (which is directly inserted into the url) or an array (that will be joined with `,`s).

### champion
- `gnar.champion.all()` maps to [/api/lol/{region}/v1.2/champion](https://developer.riotgames.com/api/methods#!/776/2763)
- `gnar.champion.by_id(id)` maps to [/api/lol/{region}/v1.2/champion/{id}](https://developer.riotgames.com/api/methods#!/776/2762)
<commit_msg>changed erroneous summoners to summoner in docs<commit_after># gnar

A wrapper for the official [League of Legends API](https://developer.riotgames.com).

## Getting Started

1. obtain an API key from https://developer.riotgames.com by logging in with your League of Legends Account

2. install *gnar* as npm module (use `--save` to persist this to your package.json)

  ```bash
  npm install gnar
  ```

3. require *gnar* in your app

  ```javascript
  var gnar = require('gnar')('<your-api-key>', '<your region>');
  // you can change api-key and region later with
  //   gnar.configuration.setKey('<new-key>') and
  //   gnar.configuration.setRegion('<new-region>')
  ```

4. use *gnar* as you would expect

  ```javascript
  gnar.summoner.by_name('refridgerator').pipe(process.stdout)
  // all stream-based! pipe to what you need
  ```

5. as API requests are limited (to 10 per 10s, 500 per 10min by default) you may want to cache your results like

  ```javascript
  var cache = require('stream-cache'), fs = require('fs');
  // easiest way to cache (not fastest!): write to file system
  gnar.lol_static_data.champion.all().pipe(fs.createWriteStream('cache/champion.json'));
  // then retrieve it again
  var champion = fs.createReadStream('cache/champion.json');
  ```

## API documentation

As this is a pure wrapper for the League of Legends API, please refer the [full documentation](https://developer.riotgames.com/api/methods) for details on the API endpoints.

Method parameters (like `id`, `summonerId`) are parsed to strings (automatically by JavaScript) and inserted into the request url. Where the League of Legends API allows multiple entries (where the parameter is in plural, like `summonerIds`, `teamIds`) you can either pass a string (which is directly inserted into the url) or an array (that will be joined with `,`s).

### champion
- `gnar.champion.all()` maps to [/api/lol/{region}/v1.2/champion](https://developer.riotgames.com/api/methods#!/776/2763)
- `gnar.champion.by_id(id)` maps to [/api/lol/{region}/v1.2/champion/{id}](https://developer.riotgames.com/api/methods#!/776/2762)

{'fraction_non_alphanumeric': 0.13225113392217713, 'fraction_numerical': 0.015278109333969921, 'mean_word_length': 4.1792336217552535, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 10, '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': '7400911', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1286, 'n_words': 456}