# git-odb

> object database manager for git

Latest version **1.0.0** (published 2016-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install git-odb
pnpm add git-odb
yarn add git-odb
bun add git-odb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-06-18 |
| First published | 2013-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Chris Dickinson |
| Maintainers | chrisdickinson |
| Keywords | git, object, database, odb |

## Links

- npm: https://www.npmjs.com/package/git-odb
- Repository: https://github.com/chrisdickinson/git-odb
- Homepage: https://github.com/chrisdickinson/git-odb#readme
- Issues: https://github.com/chrisdickinson/git-odb/issues
- npm.io page: https://npm.io/package/git-odb

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-06-18
- 0.0.2 — 2013-03-24
- 0.0.1 — 2013-03-18

## README

# git-odb

Git object database manager.

Manage reading and writing across several backends.

```javascript
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

---
_Source: https://npm.io/package/git-odb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
