1.0.0 • Published 5 years ago

fetch-gh-content v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

fetch-gh-content

Fetch github repo content

Please consider starring the project to show your ❤️ and support.

NPM version NPM download CircleCI License donate

  • 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

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. 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).

evila.me · GitHub @evillt · Twitter @evillt