metacran/gh-ls

Name: gh-ls

Owner: metacran

Description: List files in a GitHub repository

Created: 2015-05-22 19:56:45.0

Updated: 2015-05-23 19:25:17.0

Pushed: 2015-05-27 04:54:53.0

Homepage: null

Size: 132

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

gh-ls Build Status

Get list of files form a GitHub repository

Install
m install --save gh-ls
Usage
ghls = require('gh-ls');

('metacran/gh-ls', function (err, list) {
console.log(list);
// =>  { sha: '01a870392179ec5fdd59d99d58cfb89bc751df31',
// =>    url: 'https://api.github.com/repos/metacran/gh-ls/git/trees/01a870392179ec5fdd59d99d58cfb89bc751df31',
// =>    tree:
// =>    [ { path: '.gitignore',
// =>     mode: '100644',
// =>     type: 'blob',
// =>     sha: '07e6e472cc75fafa944e2a6d4b0f101bc476c060',
// =>     size: 14,
// =>     url: 'https://api.github.com/repos/metacran/gh-ls/git/blobs/07e6e472cc75fafa944e2a6d4b0f101bc476c060' },
// =>   { path: '.travis.yml',
// =>     mode: '100644',
// =>     type: 'blob',
// =>     sha: 'dedfc07f240bb03f9e07d8a5ed89983db52781ff',
// =>     size: 72,
// =>     url: 'https://api.github.com/repos/metacran/gh-ls/git/blobs/dedfc07f240bb03f9e07d8a5ed89983db52781ff' },
// =>   { path: 'README.md',
// =>     mode: '100644',
// =>     type: 'blob',
// =>     sha: '1445ec385e1479cc60957f81f8393e0c8085a675',
// =>     size: 1092,
// =>     url: 'https://api.github.com/repos/metacran/gh-ls/git/blobs/1445ec385e1479cc60957f81f8393e0c8085a675' },
// =>   { path: 'index.js',
// =>     mode: '100644',
// =>     type: 'blob',
// =>     sha: 'fbff262b9b3d507ff858ad87b0515e4a28fa3ed1',
// =>     size: 700,
// =>     url: 'https://api.github.com/repos/metacran/gh-ls/git/blobs/fbff262b9b3d507ff858ad87b0515e4a28fa3ed1' },
// =>   { path: 'package.json',
// =>     mode: '100644',
// =>     type: 'blob',
// =>     sha: '541e21012186ceaf61a804e1798c629feda86fc6',
// =>     size: 564,
// =>     url: 'https://api.github.com/repos/metacran/gh-ls/git/blobs/541e21012186ceaf61a804e1798c629feda86fc6' },
// =>   { path: 'test.js',
// =>     mode: '100644',
// =>     type: 'blob',
// =>     sha: 'b720394932711476abb9d31be4fa4d8a6c291a37',
// =>     size: 633,
// =>     url: 'https://api.github.com/repos/metacran/gh-ls/git/blobs/b720394932711476abb9d31be4fa4d8a6c291a37' } ],
// =>     truncated: false }

API
ghls(repo, [params], callback)
repo

Required
Type: string

GitHub repository.

params

Type: object

Optional parameters:

callback(err, list) list

Type: object

Various file and directory data.

See also
License

MIT © Gabor Csardi


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.