Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-github

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-github

A simple, request-inspired and promise-based wrapper around GitHub's API.

  • 0.9.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.2K
increased by330.52%
Maintainers
1
Weekly downloads
 
Created
Source

Simple GitHub

A simple, request-inspired and promise-based wrapper around GitHub's API.

The idea here is to simplify interacting with the GH API for basic scenarios. It uses Q promises (as promises are such a nicer abstraction then callbacks). It doesn't support streaming at present mostly because I didn't really need streaming for my use cases, and also because I'm still trying to figure out what the best practice is for handling streams in node.js (especially when these contain JSON data you want to parse).

The data set I'm working with and my use cases makes it so that it perfectly reasonable to send multiple gets and lump together the output of paginated data when fulfilling the promise. This might turn out to be a bad idea but I don't know better for now.

Because what I want to do is use the API as quickly as possible, this module supports copy pasting the URLs directly from the documentation:

var gh = require("simple-github")({
  owner: "tobie",
  repo: "simple-github"
});

gh.request("GET /repos/:owner/:repo/pulls/:number", { number: 349 }).then(console.log);

Interpolation is automatic.

Similarly, simple-github also accepts URI templates (as these are common in the GitHub API):

var gh = require("simple-github")({
  owner: "tobie",
  repo: "simple-github"
});

gh.request("https://api.github.com/repos/{owner}/{repo}/commits", { method: "get" }).then(console.log);

Keywords

FAQs

Package last updated on 09 Jan 2018

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