npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

git-packidx-parser

1.0.0

@chrisdickinson

npmHomeRepoSnykSocket
Downloads:9
$ npm install git-packidx-parser
DailyWeeklyMonthlyYearly

git-packidx-parser

given a packfile, create a stream to parse it's index file.

currently only supports v2 idx files.

Build Status browser support


var packidx = require('git-packidx-parser')

fs.createReadStream('path/to/packidx')
  .pipe(packidx(<packfile>))
  .on('data', function(packidx) {

  })

api

packidx() -> packidx stream

return a writable stream that emits a single 'data' event containing a PackIDX instance.

PackIDX#find(Buffer objectID) -> {offset object} | null

attempt to find objectID in this index file. returns either an offset object, or null if the objectID isn't present in this pack index.

if an offset object is returned, it'll look like so:

{ offset: number | {hi: number, lo: number}
, next: number | {hi: number, lo: number} | null }

license

MIT