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

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

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

codecov.io travis-ci.org codecov.io

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

github-getter is a small module to take the hassle out of downloading files from github. Download specific files, or specify repositories/users and recieve lists of files/repositories available.

Why?

Save time digging around docs / fiddling with with headers.

How?

get a github api token. Create a personal one here or use oauth.

node 6
const { user, repo, file } = require('./src/')(process.env.ghtoken)

const logContent = (err, res) => {
  if (err) throw err
  console.log(res.content)
}

file({ repoName: 'des-des/github-getter', filePath: 'README.md' }, logContent)

repo({ repoName: 'des-des/github-getter' }, (err, githubGetter) => {
  if (err) throw err
  githubGetter['README.md'](logContent)
})

user({ name: 'des-des' }, (err, desdes) => {
  if (err) throw err
  desdes['github-getter']((err, githubGetter) => {
    if (err) throw err
    githubGetter['README.md'](logContent)
  })
})

Documentation

  • init - token => githubGetter, where
    • token - github api token.
  • githubGetter - object with
    • file - ({ repoName, filePath }, cb) => {}, where
      • repoName - name of the repository,
      • filePath - path of desired file, ie assets/someData.json,
      • cb - (err, githubFile) => {}.
    • repo - ({ repoName }, cb) => {}, where
      • repoName - name of the repository,
      • cb - (err, githubRepo) => {}.
    • user - ({ name }, cb) => {}, where
      • name - github user name,
      • cb - (err, githubUser) => {}.
    • org - ({ name }, cb) => {}, where
      • name - github org name,
      • cb - (err, githubUser) => {}.
  • githubFile - object containing
    • content - string containing file content
  • githubRepo - an object were keys are paths to repos files:
    • [filepath] - cb(err, githubFile) => {}.
  • githubUser - an object were keys are repo names belonging to the user/org:
    • [repoName] - cb(err, githubRepo) => {}.

Keywords

FAQs

Package last updated on 05 Jun 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