Socket
Book a DemoInstallSign in
Socket

git-odb

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-odb

object database manager for git

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

git-odb

Git object database manager.

Manage reading and writing across several backends.

var odb = require('git-odb')

var db = odb()

db.add({
  readable: maybe
, writable: maybe
, read: function(shaBuffer, ready) { }
, write: function(shaBuffer, object, ready) { }
}, readPreference, writePreference)

db.find(sha, function(err, obj) {

})

API

odb.add(backend, readPreference = 0, writePreference = 0) -> odb

add a backend. if the backend is readable, add it to the list of read backends using the readPreference (the higher the earlier it will be read from).

if the backend is writable, add it to the list of write backends. only the backend at the front of the list will be used for writing.

odb.remove(backend) -> odb

remove the backend from reading and writing.

odb.find(shaBuffer, ready(err, rawGitObject)) -> odb

query all of the readable backends for an object matching shaBuffer.

call the callback with err if an error occurred in a backend, undefined if the object wasn't found, or a {type: numericGitType, data: Buffer} representing the object.

odb.save(shaBuffer, object, ready(err)) -> odb

save a new git object into this ODB using the write backend with the highest preference.

License

MIT

Keywords

git

FAQs

Package last updated on 18 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts