is-gist-starred
v1.0.1
Published
Check if you have starred a given gist or not
Downloads
9
Maintainers
Readme
is-gist-starred
Check if you have starred a given gist or not
const isGistStared = require('is-gist-starred');
// https://gist.github.com/domenic/2790533
isGistStared('2790533', {token: 'xxxx'}).then(starred => {
starred; //=> true
});
Installation
npm install is-gist-starred
API
const isGistStarred = require('is-gist-starred');
isGistStarred(gistId [, options])
gistId: String
(a gist ID, for example https://gist.github.com/tim/34309 → '34309'
)
options: Object
(gh-get
options)
Return: Promise
instance
It creates an API request to check if the gist is starred by the authentificated user, and returns a promise.
When it gets the result successfully, the promise will be fulfilled 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 with an error.
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.