git-packed-ref-parse
streaming git packed-ref parser
Last updated 12 years ago by chrisdickinson .
MIT · Repository · Original npm · Tarball · package.json
$ npm install git-packed-ref-parse 
SYNC missed versions from official npm registry.

git-packed-ref-parse

parse packed-ref file streams into javascript objects.

// after git gc in a git repo
var fs = require('fs')
  , parse = require('git-packed-ref-parse')

fs.createReadStream('.git/packed-refs')
  .pipe(parse())
  .on('data', console.log)

API

parse() -> parse stream

create a parse stream. when piped to, it will set the encoding of the source stream to utf8.

data event

the parse stream will emit data events for each ref contained in the packed-ref file.

they take this form:

{ "hash": "40 character git hash"
, "name": "ref name"
, "commit": null | "40 character git hash" }

commit will usually be null, except for annotated tag references.

License

MIT

Current Tags

  • 0.0.0                                ...           latest (12 years ago)

1 Versions

  • 0.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE