node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…


list all git objects (in recency order)


given a find function, a list of hashes, and an optional list of "end" hashes, list all git objects in recency order as a stream.

var list = require('git-list-objects')
  , open = require('git-fs-repo')
open('path/to/.git', function(err, repo) {
  var hashes = {
    return x.hash
  list(repo.find, hashes)
    .on('data', function(meta) {
      meta.type // integer type 
      meta.path // [{mode: 0000, name: '', hash: Buffer}] 
      meta.size // integer byte size of object 
      meta.obj  // original git object  

create a stream that will start emitting data on the next tick.

find is a function that takes a string object id and a ready node-style (err, data) callback.

hashes (and endpoints, if present) should be a list of string object ids.