🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

repo-images

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repo-images

Collect all the image file URLs in a GitHub repository

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

repo-images

Collect all the image file URLs in a GitHub repository

Installation

npm install repo-images --save

Usage

const repoImages = require('repo-images')

repoImages('user/repo').then(images => {
  // an array of image objects
})

Each object in the returned array has this structure:

{
  path: 'build/icon.icns',
  mode: '100644',
  type: 'blob',
  sha: '3e7e2a36f9d1a5dfcaae886d0c0e5043b3ffee6a',
  size: 1192844,
  url: 'https://api.github.com/repos/ummoji/ummoji-desktop/git/blobs/3e7e2a36f9d1a5dfcaae886d0c0e5043b3ffee6a',
  rawgit: 'https://cdn.rawgit.com/ummoji/ummoji-desktop/master/build/icon.icns'
}

The default branch is master, but you can override it:

repoImages('user/repo', {branch: 'not-master'})

Authentication

  • If token option is set, it will be used.
  • If process.env.GITHUB_ACCESS_TOKEN is set, it will be used.
  • If neither is set, an unauthenticated request will be made.

Promises or Callbacks

If you don't like promises, you can use a node-style callback:

repoImages('user/repo', function(err, images) {
  if (err) throw err
  console.log(images)
})

Tests

npm install
npm test

Dependencies

  • gh-got: Convenience wrapper for got to interact with the GitHub API
  • pify: Promisify a callback-style function

Dev Dependencies

  • standard: JavaScript Standard Style
  • tap-spec: Formatted TAP output like Mocha's spec reporter
  • tape: tap-producing test harness for node and browsers

License

MIT

Generated by package-json-to-readme

FAQs

Package last updated on 14 Dec 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