fetch-gh-content
v1.0.0
Published
Fetch github repo content
Downloads
2
Readme
fetch-gh-content
Fetch github repo content
Please consider starring the project to show your ❤️ and support.
- tiny size
- zero dependencies
Install
yarn add fetch-gh-content
Usage
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<string | Array<object>>
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
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
fetch-gh-content © evillt, Released under the MIT License.
Authored and maintained by EVILLT with help from contributors (list).