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 days 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 (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T06:17:15.000Z (5 months ago)
- Last Synced: 2024-10-24T01:31:25.455Z (13 days 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.
[![npm (scoped)](https://img.shields.io/npm/v/@varandas/fetch-readme.svg)](https://www.npmjs.com/package/@varandas/fetch-readme)
[![npm](https://img.shields.io/npm/dm/@varandas/fetch-readme.svg)](https://npmcharts.com/compare/@varandas/fetch-readme)[![Build Status](https://travis-ci.org/AndreVarandas/fetch-readme.svg?branch=master)](https://travis-ci.org/AndreVarandas/fetch-readme)
[![Codecov Coverage](https://img.shields.io/codecov/c/github/AndreVarandas/fetch-readme/master.svg?style=flat-square)](https://codecov.io/gh/AndreVarandas/fetch-readme/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Known Vulnerabilities](https://snyk.io/test/github/AndreVarandas/fetch-readme/badge.svg?targetFile=package.json)](https://snyk.io/test/github/AndreVarandas/fetch-readme?targetFile=package.json)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](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)