Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/transitive-bullshit/github-is-starred

Checks if a user has starred a particular GitHub repo.
https://github.com/transitive-bullshit/github-is-starred

github github-api star starred

Last synced: 2 months ago
JSON representation

Checks if a user has starred a particular GitHub repo.

Awesome Lists containing this project

README

        

# github-is-starred

> Checks if a user has starred a particular GitHub repo.

[![NPM](https://img.shields.io/npm/v/github-is-starred.svg)](https://www.npmjs.com/package/github-is-starred) [![Build Status](https://travis-ci.com/transitive-bullshit/github-is-starred.svg?branch=master)](https://travis-ci.com/transitive-bullshit/github-is-starred) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save github-is-starred
```

## Usage

```js
const githubIsStarred = require('github-is-starred')

await githubIsStarred({
username: 'blaise-hansen',
repo: 'transitive-bullshit/create-react-library'
}) // => true
```

## API

### githubIsStarred

Checks if a user has starred a particular GitHub repo.

Type: `function (opts): Promise`

- `opts` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Config options
- `opts.username` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** GitHub username of user to check
- `opts.repo` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Full name of GitHub repo to check
- `opts.client` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional authenticated `@octokit/rest` client

## Related

- [github-is-starred-cli](https://github.com/transitive-bullshit/github-is-starred-cli) - CLI for this module.
- [@octokit/rest](https://github.com/octokit/rest.js) - GitHub REST API client for Node.js.

## License

MIT © [Travis Fischer](https://github.com/transitive-bullshit)

Support my OSS work by following me on twitter twitter