# @marionebl/git-fs-repo

> filesystem backed git repository

Latest version **0.1.2** (published 2016-06-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @marionebl/git-fs-repo
pnpm add @marionebl/git-fs-repo
yarn add @marionebl/git-fs-repo
bun add @marionebl/git-fs-repo
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2016-06-12 |
| First published | 2016-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Chris Dickinson |
| Maintainers | marionebl |
| Keywords | git, filesystem, fs, repo, repository |

## Links

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

## Dependencies (8)

- [git-odb](https://npm.io/package/git-odb.md) 0.0.2
- [through](https://npm.io/package/through.md) ~2.2.7
- [git-to-js](https://npm.io/package/git-to-js.md) 0.0.3
- [ls-stream](https://npm.io/package/ls-stream.md) 0.0.4
- [git-odb-pack](https://npm.io/package/git-odb-pack.md) 0.0.7
- [git-odb-loose](https://npm.io/package/git-odb-loose.md) 0.0.5
- [git-autoregister-odb](https://npm.io/package/git-autoregister-odb.md) 0.0.2
- [@marionebl/git-load-refs](https://npm.io/package/@marionebl/git-load-refs.md) ^0.1.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.2 (latest) — 2016-06-12
- 0.1.1 — 2016-06-03
- 0.1.0 — 2016-06-03

## README

# git-fs-repo

filesystem-backed read-only git repository object.

ties together all of the fs-based ODB backends, and
the ref discovery mechanism.

```javascript
var load = require('git-fs-repo')

load('/path/to/repository/.git', function(err, git) {
  var head = git.ref('HEAD').hash

  git.find(head, function(err, obj) {

  }) 
})
```

## API

#### load(dir, ready(err, repo)) -> undefined

Load a git repository from dir. `ready` will be
called with the error (if any), and the repository
object.

#### repo.find(Buffer | String hash, ready(err, object))

Lookup a git object from the backends. Hash must be either
a 40-character hexadecimal string, or a 20-byte Buffer.

If no object was found, there will be no error, but also no
data.

If there was an error in any of the backends, it will be propagated
as `err`.

**NB**: `find` is tightly bound to the repository object, since so
many other `git-*` projects rely on having a `find` function provided.

So instead of doing:

```javascript
var walk = require('git-walk-tree')
  , repo = /* some repo */0;

walk(find, head_commit)

function find(oid, ready) {
  return repo.find(oid, ready)
}
```

You can do:

```javascript
var walk = require('git-walk-tree')
  , repo = /* some repo */0;

walk(repo.find, head_commit)
```

#### repo.ref(name[, follow=true]) -> Reference

Lookup a reference by name. If follow is true or not given, it will
dereference any intermediary symbolic references (i.e., refs that point
at other refs.)

#### repo.refs([follow=true]) -> [Reference, ...]

Return all references. If follow is true or not given, it will
dereference symbolic links, and the returned list will include only
one reference per unique hash.

## License

MIT

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