git-file

0.0.1 • Public • Published

git-file

read file and directory data from a git repo as streams

build status

example

stream a directory listing

var git = require('git-file');
var joinStream = require('join-stream');
 
var commit = process.argv[2];
var dir = process.argv[3];
 
git.list(commit, dir)
    .pipe(joinStream('\n'))
    .pipe(process.stdout)
;

stream a file

var git = require('git-file');
var joinStream = require('join-stream');
 
var commit = process.argv[2];
var file = process.argv[3];
 
git.read(commit, file).pipe(process.stdout);

methods

var git = require('git-file')

git.list(ref, dir, opts)

List the contents of a directory dir at the revision ref.

Returns a stream with a 'data' event for each file where directories have a trailing '/'.

git.read(ref, file, opts)

Return a stream with the contents of file at the revision ref.

git(ref, opts)

Return an object with list and read bound to the ref and/or opts provided.

install

With npm do:

npm install git-file

Readme

Keywords

none

Package Sidebar

Install

npm i git-file

Weekly Downloads

978

Version

0.0.1

License

MIT

Last publish

Collaborators

  • nopersonsmodules