Blob.createFromBuffer Async

Blob.createFromBuffer(repo, buffer, len).then(function(oid) {
  // Use oid
});
Parameters Type  
repo Repository repository where to blob will be written
buffer Buffer data to be written into the blob
len Number length of the data
Returns  
Oid return the id of the written blob

Blob.createFromDisk Async

Blob.createFromDisk(repo, path).then(function(oid) {
  // Use oid
});
Parameters Type  
repo Repository repository where the blob will be written. this repository can be bare or not
path String file from which the blob will be created
Returns  
Oid return the id of the written blob

Blob.createFromWorkdir Async

Blob.createFromWorkdir(repo, relative_path).then(function(oid) {
  // Use oid
});
Parameters Type  
repo Repository repository where the blob will be written. this repository cannot be bare
relative_path String file from which the blob will be created, relative to the repository’s working dir
Returns  
Oid return the id of the written blob

Blob.filteredContent Async

Blob.filteredContent(blob, as_path, check_for_binary_data).then(function(buffer) {
  // Use buffer
});
Parameters Type  
blob Blob Pointer to the blob
as_path String Path used for file attribute lookups, etc.
check_for_binary_data Number Should this test if blob content contains NUL bytes / looks like binary data before applying filters?
Returns  
Buffer The git_buf to be filled in

Blob.lookup Async

Blob.lookup(repo, id).then(function(blob) {
  // Use blob
});

Retrieves the blob pointed to by the oid

Parameters Type  
repo Repository The repo that the blob lives in
id String, Oid, Blob The blob to lookup
Returns  
Blob  

Blob.lookupPrefix Async

Blob.lookupPrefix(repo, id, len).then(function(blob) {
  // Use blob
});
Parameters Type  
repo Repository the repo to use when locating the blob.
id Oid identity of the blob to locate.
len Number the length of the short identifier
Returns  
Blob  

Blob#content Sync

var buffer = blob.content();

Retrieve the content of the Blob.

Returns  
Buffer Contents as a buffer.

Blob#dup Async

blob.dup().then(function(blob) {
  // Use blob
});
Returns  
Blob  

Blob#filemode Sync

var number = blob.filemode();

Retrieve the Blob’s type.

Returns  
Number The filemode of the blob.

Blob#id Sync

var oid = blob.id();
Returns  
Oid SHA1 hash for this blob.

Blob#isBinary Sync

var result = blob.isBinary();
Returns  
Number 1 if the content of the blob is detected
as binary; 0 otherwise.  

Blob#owner Sync

var repository = blob.owner();
Returns  
Repository Repository that contains this blob.

Blob#rawcontent Sync

var buffer = blob.rawcontent();
Returns  
Buffer  

Blob#rawsize Sync

var result = blob.rawsize();
Returns  
Number size on bytes

Blob#toString Sync

var string = blob.toString();

Retrieve the Blob’s content as String.

Returns  
String Contents as a string.