https://github.com/2nthony/fetch-gh-content
Fetch github repo content
https://github.com/2nthony/fetch-gh-content
fetch github module node
Last synced: 3 months 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:32:23.000Z (over 1 year ago)
- Last Synced: 2025-04-03T22:02:42.966Z (3 months 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.
[](https://npmjs.com/package/fetch-gh-content)
[](https://npmjs.com/package/fetch-gh-content)
[](https://circleci.com/gh/evillt/fetch-gh-content/tree/master)
[](./LICENSE)
[](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)