https://github.com/andrevarandas/fetch-readme
Fetch a readme.md from a github repository.
https://github.com/andrevarandas/fetch-readme
github readme typescript-library utility
Last synced: 2 months ago
JSON representation
Fetch a readme.md from a github repository.
- Host: GitHub
- URL: https://github.com/andrevarandas/fetch-readme
- Owner: AndreVarandas
- License: mit
- Created: 2019-01-19T16:27:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T06:17:15.000Z (about 1 year ago)
- Last Synced: 2025-05-01T00:54:55.033Z (2 months ago)
- Topics: github, readme, typescript-library, utility
- Language: TypeScript
- Size: 1010 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Fetch Readme 📖
Fetch a raw readme.md from a public github repository.
[](https://www.npmjs.com/package/@varandas/fetch-readme)
[](https://npmcharts.com/compare/@varandas/fetch-readme)[](https://travis-ci.org/AndreVarandas/fetch-readme)
[](https://codecov.io/gh/AndreVarandas/fetch-readme/)
[](https://github.com/semantic-release/semantic-release)
[](https://snyk.io/test/github/AndreVarandas/fetch-readme?targetFile=package.json)
[](https://github.com/AndreVarandas/fetch-readme/blob/master/LICENSE)### Install
With Yarn
- `yarn add @varandas/fetch-readme`With npm
- `npm i --save @varandas/fetch-readme`### Usage
```javascript
// Usage for commonjs
const { fetchReadme } = require('@varandas/fetch-readme');fetchReadme({
username: 'Microsoft',
repository: 'TypeScript'
}).then(readme => console.log(readme));// OR ES2015
import { fetchReadme } from '@varandas/fetch-readme'(async () => {
const readme = await fetchReadme({
username: 'Microsoft',
repository: 'TypeScript'
})
console.log(readme)
})()
```### Configuration Options
Both username and repository properties are required.
`branch` defaults to `master` and `readme` to `README.md`.```javascript
const config = {
username: 'andrevarandas',
repository: 'the-repository-name',
branch: 'develop',
readme: 'readme.md'
}
```**Note** The readme file name is case sensitive.
[LICENSE - MIT - André Varandas](LICENSE)