Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

metacran/gh-ls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-ls Build Status

Get list of files form a GitHub repository

Install

$ npm install --save gh-ls

Usage

var ghls = require('gh-ls');

ghls('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

About

List files in a GitHub repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published