An open API service indexing awesome lists of open source software.

https://github.com/jonschlinkert/github-trees

Get a tree from a GitHub repository.
https://github.com/jonschlinkert/github-trees

api github javascript nodejs tree trees

Last synced: 30 days ago
JSON representation

Get a tree from a GitHub repository.

Awesome Lists containing this project

README

        

# github-trees [![NPM version](https://img.shields.io/npm/v/github-trees.svg?style=flat)](https://www.npmjs.com/package/github-trees) [![NPM monthly downloads](https://img.shields.io/npm/dm/github-trees.svg?style=flat)](https://npmjs.org/package/github-trees) [![NPM total downloads](https://img.shields.io/npm/dt/github-trees.svg?style=flat)](https://npmjs.org/package/github-trees)

> Get a tree from a GitHub repository.

Follow this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), for updates on this project and others.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save github-trees
```

## Usage

See [github-base](https://github.com/jonschlinkert/github-base) for documentation for all options and authentication choices.

```js
var tree = require('github-trees');
var opts = {
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD'
};

tree('breakdance/breakdance', opts)
.then(function(res) {
console.log(res);
})
```

## Get a Tree Recursively

```js
var tree = require('github-trees');
var opts = {
recursive: true,
username: 'YOUR_USERNAME',
password: 'YOUR_PASSWORD'
};

tree('breakdance/breakdance', opts)
.then(function(res) {
console.log(res);
})
```

## About

### Related projects

You might also be interested in these projects:

* [get-file](https://www.npmjs.com/package/get-file): CLI to get a single file from Github repository. | [homepage](https://github.com/jonschlinkert/get-file "CLI to get a single file from Github repository.")
* [gists](https://www.npmjs.com/package/gists): Methods for working with the GitHub Gist API. Node.js/JavaScript | [homepage](https://github.com/jonschlinkert/gists "Methods for working with the GitHub Gist API. Node.js/JavaScript")
* [github-base](https://www.npmjs.com/package/github-base): JavaScript wrapper that greatly simplifies working with GitHub's API. | [homepage](https://github.com/jonschlinkert/github-base "JavaScript wrapper that greatly simplifies working with GitHub's API.")
* [repos](https://www.npmjs.com/package/repos): Pull down a list of GitHub repositories for the specified user or org, and save… [more](https://github.com/jonschlinkert/repos) | [homepage](https://github.com/jonschlinkert/repos "Pull down a list of GitHub repositories for the specified user or org, and save to a local JSON file.")
* [topics](https://www.npmjs.com/package/topics): Get and update GitHub repository topics. | [homepage](https://github.com/jonschlinkert/topics "Get and update GitHub repository topics.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.

### Building docs

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 21, 2017._