---
sidebar_class_name: node-only
hide_table_of_contents: true
---

# GitHub

This example goes over how to load data from a GitHub repository.
You can set the `GITHUB_ACCESS_TOKEN` environment variable to a GitHub access token to increase the rate limit and access private repositories.

## Setup

The GitHub loader requires the [ignore npm package](https://www.npmjs.com/package/ignore) as a peer dependency. Install it like this:

```bash npm2yarn
npm install ignore
```

## Usage

import CodeBlock from "@theme/CodeBlock";
import Example from "@examples/document_loaders/github.ts";

<CodeBlock language="typescript">{Example}</CodeBlock>

The loader will ignore binary files like images.

### Using .gitignore syntax

To ignore specific files, you can pass in an `ignorePaths` array into the constructor:

import IgnoreExample from "@examples/document_loaders/github_ignore_paths.ts";

<CodeBlock language="typescript">{IgnoreExample}</CodeBlock>
