Fork me on GitHub
nodegit by tbranyen & faceleg

Blob

new Blob(rawRepo, rawBlob)

Blob convenience class constructor.
Parameters:
Name Type Argument Default Description
rawRepo git.raw.Repo Raw repository object.
rawBlob git.raw.Blob <optional>
new git.raw.Blob(rawRepo) Raw blob object.
Source:

Methods

content(callback)

Retrieve the blob's content.
Parameters:
Name Type Description
callback Blob~contentCallback
Source:

createFromFile(path, callback)

Create a new blob from the file at the given path.
Parameters:
Name Type Description
path String Full path to the file.
callback Blob~createFromFileCallback
Source:

createFromFile(buffer, callback)

Create a new blob from the given buffer.
Parameters:
Name Type Description
buffer Buffer Buffer used to create blob.
callback Blob~createFromBufferCallback
Source:

lookup(oid, callback)

Retrieve the blob represented by the oid.
Parameters:
Name Type Description
oid git.raw.Oid The OID representing the blob to lookup.
callback Blob~lookupCallback
Source:

rawContent(callback)

Retrieve the blob's raw content buffer.
Parameters:
Name Type Description
callback Blob~rawContentCallback
Source:

Type Definitions

contentCallback(error, content)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
content String | null The content of the blob or null.
Source:

createFromBufferCallback(error, content)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
content Blob | null The new blob or null.
Source:

createFromFileCallback(error, blob)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
blob Blob | null The new blob or null.
Source:

lookupCallback(error, blob)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
blob Blob | null Retrieved blob object or null.
Source:

rawContentCallback(error, content)

Parameters:
Name Type Description
error GitError | null An Error or null if successful.
content Buffer | null The raw content of the blob or null.
Source: