git-get-file

0.1.0 • Public • Published

git-get-file

Returns a readable stream with the contents of file (from a git repo) at the specific revision.

Usage

streamFile(repoPath, { rev: <REVISION>, file: <FILENAME> })

Example:

var streamFile = require('git-get-file');
var path = require('path');
var repoPath = path.resolve(process.env.REPO || (__dirname + '/.git'));
var rev = process.env.REV || 'master';
var file = process.env.FILE || 'package.json';
 
streamFile(repoPath, {
  rev: rev,
  file: file
}).on('error', function(err) {
  throw err;
}).on('end', function() {
  console.log('\n------ THE END ------');
}).pipe(process.stdout);

Tests

npm test

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i git-get-file

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • alessioalex