Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 4 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T06:17:15.000Z (8 months ago)
- Last Synced: 2024-10-24T01:31:25.455Z (4 months ago)
- Topics: github, readme, typescript-library, utility
- Language: TypeScript
- Size: 1010 KB
- Stars: 8
- Watchers: 3
- 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)