Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/is-gist-starred
Check if you have starred a given gist or not
https://github.com/shinnn/is-gist-starred
Last synced: 27 days ago
JSON representation
Check if you have starred a given gist or not
- Host: GitHub
- URL: https://github.com/shinnn/is-gist-starred
- Owner: shinnn
- License: mit
- Created: 2015-12-27T07:46:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-09T11:21:57.000Z (about 8 years ago)
- Last Synced: 2024-08-14T15:07:58.298Z (3 months ago)
- Language: JavaScript
- Homepage: https://developer.github.com/v3/gists/#check-if-a-gist-is-starred
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-gist-starred
[![NPM version](https://img.shields.io/npm/v/is-gist-starred.svg)](https://www.npmjs.com/package/is-gist-starred)
[![Build Status](https://travis-ci.org/shinnn/is-gist-starred.svg?branch=master)](https://travis-ci.org/shinnn/is-gist-starred)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/is-gist-starred.svg)](https://coveralls.io/github/shinnn/is-gist-starred)
[![Dependency Status](https://david-dm.org/shinnn/is-gist-starred.svg)](https://david-dm.org/shinnn/is-gist-starred)
[![devDependency Status](https://david-dm.org/shinnn/is-gist-starred/dev-status.svg)](https://david-dm.org/shinnn/is-gist-starred#info=devDependencies)Check if you have starred a given [gist](https://gist.github.com/) or not
```javascript
const isGistStared = require('is-gist-starred');// https://gist.github.com/domenic/2790533
isGistStared('2790533', {token: 'xxxx'}).then(starred => {
starred; //=> true
});
```## Installation
[Use npm.](https://docs.npmjs.com/cli/install)
```
npm install is-gist-starred
```## API
```javascript
const isGistStarred = require('is-gist-starred');
```### isGistStarred(*gistId* [, *options*])
*gistId*: `String` (a gist ID, for example [https://gist.github.com/tim/34309](https://gist.github.com/tim/34309) → `'34309'`)
*options*: `Object` ([`gh-get` options](https://github.com/shinnn/gh-get#options))
Return: [`Promise`](http://www.ecma-international.org/ecma-262/6.0/#sec-promise-constructor) instanceIt creates an API request to check if the [gist](https://help.github.com/articles/about-gists/) is starred by the authentificated user, and returns a promise.
When it gets the result successfully, the promise will be [*fulfilled*](https://promisesaplus.com/#point-26) with a `Boolean` value that shows whether the gist is starred or not.
When the request fails or the gist is not found, the promise will be [*rejected*](https://promisesaplus.com/#point-30) with an error.
## License
Copyright (c) 2015 - 2016 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).