Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mike182uk/fetch-gists
Fetch all of your gists from GitHub
https://github.com/mike182uk/fetch-gists
gist github
Last synced: 2 months ago
JSON representation
Fetch all of your gists from GitHub
- Host: GitHub
- URL: https://github.com/mike182uk/fetch-gists
- Owner: mike182uk
- License: mit
- Archived: true
- Created: 2016-01-09T13:03:44.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2023-04-27T20:55:14.000Z (over 1 year ago)
- Last Synced: 2024-08-03T15:16:36.579Z (6 months ago)
- Topics: gist, github
- Language: JavaScript
- Homepage:
- Size: 627 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - mike182uk/fetch-gists - Fetch all of your gists from GitHub (github)
README
#### ⚠️ This project is no longer maintained
# fetch-gists
[![Version](https://img.shields.io/npm/v/fetch-gists.svg?style=flat-square)](https://www.npmjs.com/package/fetch-gists)
[![Build Status](https://img.shields.io/github/actions/workflow/status/mike182uk/fetch-gists/ci.yml?branch=main&style=flat-square)](https://github.com/mike182uk/fetch-gists/actions/workflows/ci.yml?query=workflow%3ACI)
[![Coveralls](https://img.shields.io/coveralls/mike182uk/fetch-gists/main.svg?style=flat-square)](https://coveralls.io/r/mike182uk/fetch-gists)
[![npm](https://img.shields.io/npm/dm/fetch-gists.svg?style=flat-square)](https://www.npmjs.com/package/fetch-gists)
[![License](https://img.shields.io/github/license/mike182uk/fetch-gists.svg?style=flat-square)](https://www.npmjs.com/package/fetch-gists)Fetch all of your gists from GitHub.
`fetch-gists` will handle all of the API calls needed to retrieve all of your gists from GitHub. This includes navigating the paginated results.
## Prerequisites
- GitHub account (duh!)
- GitHub [access token](https://github.com/blog/1509-personal-api-tokens) with the `gist` scope enabled## Installation
```bash
npm install --save fetch-gists
```## Usage
```js
const fetchGists = require('fetch-gists')const accessToken = ''
try {
const gists = await fetchGists(accessToken)// gists successfully retrieved
} catch (err) {
// something went wrong
}
````fetchGists` will return a promise. The promise will resolve once all gists for the account have been retrieved. Any errors that occur during the retrieval of the gists will cause the promise to reject.