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

github-getter

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-getter

Quick and easy github file retrieval

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by275%
Maintainers
1
Weekly downloads
 
Created
Source

codecov.io bitHound Overall Score bitHound Dependencies bitHound Dev Dependencies

webhooks coming soon (so you gh hosted content can tell you site when to update!)

github-getter

What?

A quick and easy way to get files from github

Why?

Hosting content on github is awesome! github-getter makes accessing those files easy (so you don't waste your precious time reading api docs!)

How?

Break down interaction with github into users, repos and files.

SETUP

  • import { GHFile, GHRepo, GHUser } from 'github-getter'

  • GHFile Input a filepath and repo name to get and GHFile object OR

  • GHRepo: Input a repo name to get a GHFile object for everything in the repo OR

  • GHUser: Input a user/org name and get a GHRepo object for each repository belonging to that user/org

USAGE

  1. navigate to https://github.com/settings/tokens
  2. click this button to create new token image
  3. create a file called config.env in your projects root
  4. add the line ghtoken=**************** to the file, adding you token.
  5. run the command npm i github-getter --save
  6. get coding!
import { gHUser, gHRepo } from 'github-getter.js';


gHUser('dwyl', true)({
 getRepos: (err, repos) => {
   repos.adoro({ // my favorate dwyl repo ;)
     getReadme: (err, readme) => readme({
       getData: console.log
       // logs the file from https://github.com/dwyl/adoro/blob/master/README.md to the console
     })
   });
 }
});

gHRepo('des-des/aibox')({
 getFiles: (err, files) => {
   files['.babelrc']({
     getData: console.log 
     // logs the file from https://github.com/des-des/aibox/blob/master/.babelrc to the console
   });
 },
 getReadme: (err, readme) => readme({
   getData: console.log
   // logs the file from https://github.com/des-des/aibox/blob/master/README.md to the console
 })
});

see src/index.es6 for the example!

Keywords

FAQs

Package last updated on 16 Feb 2016

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