npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

github-pr-api

v1.0.0

Published

A node API to access github repo pull request details

Downloads

5

Readme

Github PR API

The purpose of this API is to allow the client to access detailed information about open pull requests for a given github repository. The project is a standalone node API that can be run on any machine that has the node runtime installed.

Quick Start

Prerequisites: Install the Node Runtime

Option 1 (fastest): Using npx

$ npx github-pr-api # Start the server on a random port bound to 0.0.0.0

Option 2: npm global install

$ # Install globally via npm
$ npm i -g github-pr-api

$ # Start server bound to 127.0.0.1:8080
$ github-pr-api --host 127.0.0.1 --port 8080

^^npm bin directory must be in your path variable to work^^

Option 3: Local Setup (useful for forking or contributing)

$ # Clone the repo or download and extract the zip, then cd into it
$ git clone [email protected]:micaiahwallace/github-pr-api.git
$ cd github-pr-api

$ # Inside the project directory, install dependencies using npm
$ npm install

$ # Start up the server, the api url will log to the console
$ npm start -- --host 127.0.0.1 --port 5000

CLI Options

Further configuration can be specified with the following command line flags:

github-pr-api [options]

Options:
  --ip    127.0.0.1 - Optional: IP address to bind, default: 0.0.0.0 for all ip's
  --port  8080      - Optional: Port to bind, 0 to let system decide, default: 8080

API Documentation

Fetch all Pull Requests

GET /pulls - Fetch a list of pull requests for a given repository

Query Parameters

  • repo - Specify the repository URL in one of the following formats:
    • Full url: https://github.com/user/repo
    • Schemaless: github.com/user/repo
    • Just repo: user/repo
  • per_page - Max number of results to return per response page (default: 30)
  • page - Page number to start at based on per_page number (default: 1)

Example Request

# Retreive the 3rd page of mongodb pull requests for a 50 count page
GET /pulls?repo=mongodb/mongo&per_page=50&page=3

Example Response

{
  "total_count": 57,
  ...
  "items": [
    {
      "number": 1409,
      "title": "SERVER-58467 Czech and Slovak FTS stemmers",
      ...
    }
    ...
  ]
}

Get a single Pull Request

GET /pulls/{pr} - Fetch a pull request details by pr number

URL Parameters

  • pr - A pull-request number for a repository

Query Parameters

  • repo - Specify the repository URL in one of the following formats:
    • Full url: https://github.com/user/repo
    • Schemaless: github.com/user/repo
    • Just repo: user/repo

Example Request

# Retreive a specific pull request on the mongodb repo
GET /pulls/1380?repo=mongodb/mongo

Example Response

{
  "number": 1380,
  "title": "Update baton.md",
  "state": "open",
  "locked": false,
  "merged": false,
  "commits": 1,
  ...
}