parse and create git tree objects
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md update README Mar 18, 2013
index.js move to bops May 4, 2013
package.json 1.0.0 Jun 18, 2016
test.js initial code commit Mar 18, 2013

README.md

git-object-tree

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 = tree.read(<some git buffer>)

API

tree.read() -> 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) }

License

MIT