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.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21
decreased by-48.78%
Maintainers
1
Weekly downloads
 
Created
Source

Changelog-guru logo

npm NPM

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.* - for obtaining information about commits
  • provider.package.* - for obtaining information about package.json
  • provider.release.* - for obtaining information about repository releases

Commit

get(since, [pageIndex])

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

since

Type: Date

Sampling start date.

pageIndex

Type: number

Page index.

getCount([since])

Returns commits count, starting from the specified date.

since

Type: Date

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

Package

Contains methods for obtaining data about the status of package.json.

getLastChange(until)

Returns a pointer to the last change until the specified date.

until

Type: Date

Date until which sampling is performed.

getContent(change)

By pointer to change, returns the contents package.json

change

Type: Object

The change pointer.

Release

Contains methods for obtaining release data.

getLast()

Returns tag and date of last release.

License

MIT

Keywords

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc