parse and create git tree objects

npm install git-object-tree
8 downloads in the last week
34 downloads in the last month


git tree objects as javascript objects.

tree objects are immutable once created.

var Buffer = require('buffer').Buffer
  , tree = require('git-object-tree')

var b = tree.create(new Buffer(...))

b =<some git buffer>)

API -> Tree

read a tree from some git buffer data.

tree.create(members) -> Tree

create a tree from some source data.

members should be a list of {id: sha, mode: file mode number, name: string} objects.

all fields (save for message) may be arrays.

Tree.prototype.entries() -> [entry list]

return a list of tree entries:

{ mode: number
, name: string
, hash: Buffer(20) }



npm loves you