# @rollingversions/git-protocol

> Low level streaming parsers & serializers for [git protocol-v2](https://git-scm.com/docs/protocol-v2) and [git pack-protocol](https://git-scm.com/docs/pack-protocol) (see also: [protocol-common](https://git-scm.com/docs/protocol-common)).

Latest version **2.1.0** (published 2022-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rollingversions/git-protocol
pnpm add @rollingversions/git-protocol
yarn add @rollingversions/git-protocol
bun add @rollingversions/git-protocol
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2022-03-06 |
| First published | 2021-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.0.0 |
| Dependencies | 2 |
| Unpacked size | 237.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | forbeslindesay, rollingversions-git-client-bot |

## Links

- npm: https://www.npmjs.com/package/@rollingversions/git-protocol
- npm.io page: https://npm.io/package/@rollingversions/git-protocol

## Dependencies (2)

- [@rollingversions/git-core](https://npm.io/package/@rollingversions/git-core.md) ^1.0.0
- [@rollingversions/git-packfile](https://npm.io/package/@rollingversions/git-packfile.md) ^2.0.0

## Recent versions

- 2.1.0 (latest) — 2022-03-06
- 2.0.0 — 2021-09-13
- 1.0.0 — 2021-02-12

## README

# @rollingversions/git-protocol

Low level streaming parsers & serializers for [git protocol-v2](https://git-scm.com/docs/protocol-v2) and [git pack-protocol](https://git-scm.com/docs/pack-protocol) (see also: [protocol-common](https://git-scm.com/docs/protocol-common)).

Git terminology can be confusing. I have attempted to match the git internal names where possible, so it's easier to compare with the relevant part of the git docs. The most important thing to note is that everything is from the perspective of the server, not the client, so an "upload request" is a request sent from the client to the server that asks the server to "upload" data to the client. This is what is sent by "fetch" or "pull" commands

## API

### Capabilities

`Capabilities` are used to communicate the capabilities supported by either the server or the client. They are represented as a `Map<string, string | boolean>`.

### parseInitialResponse

```ts
function parseInitialResponse(
  response: AsyncIterableIterator<Uint8Array>,
): Promise<Capabilities>;
```

Parse the response to calling `GET https://example.com/example-repo.git/info/refs?service=git-upload-pack`

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