Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/2nthony/fetch-gh-content
Fetch github repo content
https://github.com/2nthony/fetch-gh-content
fetch github module node
Last synced: 12 days ago
JSON representation
Fetch github repo content
- Host: GitHub
- URL: https://github.com/2nthony/fetch-gh-content
- Owner: 2nthony
- License: mit
- Created: 2019-06-22T06:17:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:32:23.000Z (about 1 year ago)
- Last Synced: 2024-11-24T16:46:58.106Z (about 1 month ago)
- Topics: fetch, github, module, node
- Language: JavaScript
- Homepage:
- Size: 787 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# fetch-gh-content
> Fetch github repo content
Please consider starring the project to show your ❤️ and support.
[![NPM version](https://badgen.net/npm/v/fetch-gh-content?icon=npm)](https://npmjs.com/package/fetch-gh-content)
[![NPM download](https://badgen.net/npm/dm/fetch-gh-content?icon=npm)](https://npmjs.com/package/fetch-gh-content)
[![CircleCI](https://badgen.net/circleci/github/evillt/fetch-gh-content?icon=circleci)](https://circleci.com/gh/evillt/fetch-gh-content/tree/master)
[![License](https://badgen.net/npm/license/fetch-gh-content)](./LICENSE)
[![donate](https://badgen.net/badge/support%20me/donate/f2a)](https://donate.evila.me)- tiny size
- zero dependencies## Install
```sh
yarn add fetch-gh-content
```## Usage
```js
const fetch = require('fetch-gh-content');(async () => {
const content = await fetch({
owner: 'evillt',
repo: 'fetch-gh-content',
filepath: '__test__/plaintext'
})console.log(content) // oh my fetch-gh-content
// Use it do something you want, e.g. `fs.writeFile`
})()
```## API
`fetchGhContent(options): Promise>`
### `options: object`
#### `options.owner: string`
GitHub repo owner
#### `options.repo: string`
GitHub repo name
#### `options.filepath: PathLike`
GitHub repo file path
#### `options.token?: string`
- Default: `process.env.GITHUB_TOKEN`
GitHub access token
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D## Author
**fetch-gh-content** © [evillt](https://github.com/evillt), Released under the [MIT](./LICENSE) License.
Authored and maintained by **EVILLT** with help from contributors ([list](https://github.com/evillt/fetch-gh-content/contributors)).
> [evila.me](https://evila.me) · GitHub [@evillt](https://github.com/evillt) · Twitter [@evillt](https://twitter.com/evillt)