is-gist-starred

1.0.1 • Public • Published

is-gist-starred

NPM version Build Status Coverage Status Dependency Status devDependency Status

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

Use npm.

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.

Package Sidebar

Install

npm i is-gist-starred

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • shinnn