@studyportals/github
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

GitHub

This package aims to ease the process of interacting with GitHub.

NPM version NPM license NPM downloads

Interface:

export interface IGitHub {
	getComments(owner: string, repository: string, issueNumber?: string): Promise<IGitHubComment[]>;
	deleteComment(owner: string, repository: string, commentId: string): Promise<any>;
	postComment(owner: string, repository: string, issueNumber: string, body: string): Promise<IGitHubComment>;
}

Installation:

npm install --save @studyportals/github

Example:

TypeScript

import {GitHub} from "@studyportals/github";

const GH = new GitHub(process.env.GITHUB_TOKEN);

return GH.postComment("studyportals", "github", "1", "Comment description")
    .then((comment) => { });

Node

const github = require("@studyportals/github");
const GH = new github.GitHub(process.env.GITHUB_TOKEN);

return GH.postComment("studyportals", "github", "1", "Comment description")
    .then((comment) => { });

Development

Build Status

This package can be compiled and tested locally.

  • npm install - Install the dependencies
  • npm test - Runs the test suite (will lint and compile first)
  • npm compile - Compiles the entire project
  • npm run setup-hooks - Install Git hooks. This will add a pre-commit hook to ensure code quality.
  • npm run watch - Watch the project and compile on the fly.

Please have a look at package.json scripts section.

Publishing NPM package

This package is automatically published by TravisCI for every commit on master.

# Draft a new version
# @see: https://docs.npmjs.com/cli/version
# @see: https://semver.org/
npm version [<newversion> | major | minor | patch | prerelease ]

# Push the commit and tags
git push --follow-tags

Package Sidebar

Install

npm i @studyportals/github

Weekly Downloads

7

Version

1.0.2

License

BSD-3-Clause

Unpacked Size

11.2 kB

Total Files

9

Last publish

Collaborators