New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gh-gql

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-gql

GitHub GraphQL API client for JavaScript

0.1.0
Source
npm
Version published
Weekly downloads
8
-63.64%
Maintainers
1
Weekly downloads
 
Created
Source

gh-gql

GitHub GraphQL API client for JavaScript

Install

Yarn

yarn add gh-gql

NPM

npm install gh-gql

Usage

Make sure the token GITHUB_TOKEN is available as an environment variable.

const { GitHubProvider } = require('../lib/provider');

const provider = new GitHubProvider({
    branch: 'dev',
    owner: 'keindev',
    repository: 'gh-gql',
});

provider.commit.getCommitsCount().then(count => {
    process.stdout.write(`${count} awesome commits\n`);
});

API

'GitHubProvider' provides access to the following query objects:

  • provider.commit.* - contains methods for getting commits information
  • provider.package.* - contains methods for getting package.json information
  • provider.release.* - contains methods for obtaining information about repository releases

Commit

getCommits(date, [pageIndex])

Returns the first 100 commits, starting from the specified date, with the possibility of pagination.

date

Type: Date

Sampling start date.

pageIndex

Type: number

Page index.

getCommitsCount([date])

Returns commits count, starting from the specified date.

date

Type: Date

Sampling start date. If no date is specified, the total number of commits will be received.

Package

getChanges(date)
getContent(change)

Release

getLast()

Keywords

github

FAQs

Package last updated on 28 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts