@varandas/fetch-readme
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

Fetch Readme 📖

Fetch a raw readme.md from a public github repository.

npm (scoped) npm

Build Status Codecov Coverage semantic-release Known Vulnerabilities GitHub license

Install

With Yarn

  • yarn add @varandas/fetch-readme

With npm

  • npm i --save @varandas/fetch-readme

Usage

// 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.

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

Readme

Keywords

Package Sidebar

Install

npm i @varandas/fetch-readme

Weekly Downloads

7

Version

1.0.10

License

MIT

Unpacked Size

12.3 kB

Total Files

6

Last publish

Collaborators

  • andrevarandas