Permalink
Browse files

dawkes

  • Loading branch information...
substack committed Oct 2, 2012
1 parent b34d4bc commit 46d55a6e1b19e74f5328ba35c5b8a47a92c3d4d1
Showing with 65 additions and 4 deletions.
  1. +2 −2 example/list.js
  2. +2 −2 example/read.js
  3. +61 −0 readme.markdown
View
@@ -1,10 +1,10 @@
-var gitFile = require('../');
+var git = require('../');
var joinStream = require('join-stream');
var commit = process.argv[2];
var dir = process.argv[3];
-gitFile.list(commit, dir)
+git.list(commit, dir)
.pipe(joinStream('\n'))
.pipe(process.stdout)
;
View
@@ -1,7 +1,7 @@
-var gitFile = require('../');
+var git = require('../');
var joinStream = require('join-stream');
var commit = process.argv[2];
var file = process.argv[3];
-gitFile.read(commit, file).pipe(process.stdout);
+git.read(commit, file).pipe(process.stdout);
View
@@ -0,0 +1,61 @@
+# git-file
+
+read file and directory data from a git repo as streams
+
+# example
+
+## stream a directory listing
+
+``` js
+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
+
+``` js
+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
+
+``` js
+var git = require('git-file')
+```
+
+## git.list(ref, dir)
+
+List the contents of a directory `dir` at the
+[revision](http://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html)
+`ref`.
+
+Returns a stream with a `'data'` event for each file where directories have a
+trailing `'/'`.
+
+## git.read(ref, file)
+
+Return a stream with the contents of `file` at the
+[revision](http://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html)
+`ref`.
+
+# install
+
+With [npm](https://npmjs.org) do:
+
+```
+npm install git-file
+```

0 comments on commit 46d55a6

Please sign in to comment.