<commit_before>User Repositories
===
[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]

> Get meta data for [repositories][github-repos] associated with a user.


## Installation

``` bash
$ npm install github-user-repos
```


## Usage

``` javascript
var repos = require( 'github-user-repos' );
```

<a name="repos"></a>
#### repos( opts, clbk )

Gets meta data for [repositories][github-repos] associated with a user.

``` javascript
var opts = {
	'username': 'kgryte'
};

repos( opts, clbk );

function clbk( error, results, info ) {
	// Check for rate limit information...
	if ( info ) {
		console.error( 'Limit: %d', info.limit );
		console.error( 'Remaining: %d', info.remaining );
		console.error( 'Reset: %s', (new Date( info.reset*1000 )).toISOString() );
	}
	if ( error ) {
		throw new Error( error.message );
	}
	console.log( JSON.stringify( results ) );
	// returns <repo_data>
}
```

The `function` accepts the following `options`:
*	__token__: Github [access token][github-token].
*	__username__: Github username.
* 	__type__: repository [type][github-repos]. Can be one of `all`, `owner`, `member`,  `public`, or `private`. The `public` and `private` options are __only__ applicable if the function is provided a `token` and no `username`.
*	__sort__: method used to sort meta data. Can be one of `full_name`, `created`, `pushed`, or `updated`.
*	__direction__: sort direction; either `asc` or `desc`.
*	__visibility__: repository visibility. Can be one of `all`, `public`, or `private`. Applicable if provided a `token` and no `username`. Ignored if `type` option is present.
*	__affiliation__: repository affiliation. A comma-separated list of values, which may include: `owner`, `collaborator`, `organization_member`. Applicable if provided a `token` and no `username`. Ignored if `type` option is present. 
*	__useragent__: [user agent][github-user-agent] `string`.

To [authenticate][github-oauth2] with Github, set the [`token`][github-token] option.

``` javascript
var opts = {
	'token': '<PASSWORD>!'
};

repos( opts, clbk );
```

To specify a [user agent][github-user-agent], set the `useragent` option.

``` javascript
var opts = {
	'username': 'kgryte',
	'useragent': 'hello-github!'
};

repos( opts, clbk );
```

To return repositories of a particular [type][github-repos], set the `type` option.

``` javascript
var opts = {
	'username': 'kgryte',
	'type': 'owner'
};

repos( opts, clbk );
```

<commit_msg>Add more examples in README<commit_after>User Repositories
===
[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]

> Get meta data for [repositories][github-repos] associated with a user.


## Installation

``` bash
$ npm install github-user-repos
```


## Usage

``` javascript
var repos = require( 'github-user-repos' );
```

<a name="repos"></a>
#### repos( opts, clbk )

Gets meta data for [repositories][github-repos] associated with a user.

``` javascript
var opts = {
	'username': 'kgryte'
};

repos( opts, clbk );

function clbk( error, results, info ) {
	// Check for rate limit information...
	if ( info ) {
		console.error( 'Limit: %d', info.limit );
		console.error( 'Remaining: %d', info.remaining );
		console.error( 'Reset: %s', (new Date( info.reset*1000 )).toISOString() );
	}
	if ( error ) {
		throw new Error( error.message );
	}
	console.log( JSON.stringify( results ) );
	// returns <repo_data>
}
```

The `function` accepts the following `options`:
*	__token__: Github [access token][github-token].
*	__username__: Github username.
* 	__type__: repository [type][github-repos]. Can be one of `all`, `owner`, `member`,  `public`, or `private`. The `public` and `private` options are __only__ applicable if the function is provided a `token` and no `username`.
*	__sort__: method used to sort meta data. Can be one of `full_name`, `created`, `pushed`, or `updated`.
*	__direction__: sort direction; either `asc` or `desc`.
*	__visibility__: repository visibility. Can be one of `all`, `public`, or `private`. Applicable if provided a `token` and no `username`. Ignored if `type` option is present.
*	__affiliation__: repository affiliation. A comma-separated list of values, which may include: `owner`, `collaborator`, `organization_member`. Applicable if provided a `token` and no `username`. Ignored if `type` option is present. 
*	__useragent__: [user agent][github-user-agent] `string`.

To [authenticate][github-oauth2] with Github, set the [`token`][github-token] option.

``` javascript
var opts = {
	'token': '<PASSWORD>!'
};

repos( opts, clbk );
```

To specify a [user agent][github-user-agent], set the `useragent` option.

``` javascript
var opts = {
	'username': 'kgryte',
	'useragent': 'hello-github!'
};

repos( opts, clbk );
```

To return repositories of a particular [type][github-repos], set the `type` option.

``` javascript
var opts = {
	'username': 'kgryte',
	'type': 'owner'
};

repos( opts, clbk );
```

To return repositories of a particular [visibility][github-repos], set the `visibility` option.

``` javascript
var opts = {
	'token': '<PASSWORD>!',
	'visibility': 'private'
};

repos( opts, clbk );
```

To return repositories of a particular [affiliation][github-repos], set the `affiliation` option.

``` javascript
var opts = {
	'token': '<PASSWORD>!',
	'affiliation': 'collaborator,organization_member'
};

repos( opts, clbk );
```


{'fraction_non_alphanumeric': 0.1663688348820586, 'fraction_numerical': 0.0017869907076483202, 'mean_word_length': 4.812045690550363, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, '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': '6450163', 'n_tokens_mistral': 1955, 'n_tokens_neox': 1785, 'n_words': 584}