# hpack

> An implementation of RFC7541 (a.k.a HPACK)

Latest version **1.0.0** (published 2015-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install hpack
pnpm add hpack
yarn add hpack
bun add hpack
```

## 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 | 2015-05-18 |
| First published | 2015-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Masakazu Kitajo |
| Maintainers | maskit |
| Keywords | RFC7541, HPACK |

## Links

- npm: https://www.npmjs.com/package/hpack
- Repository: https://github.com/maskit/hpack
- Issues: https://github.com/maskit/hpack/issues
- npm.io page: https://npm.io/package/hpack

## Recent versions

- 1.0.0 (latest) — 2015-05-18

## README

# HPACK

An implementation of RFC 7541 (a.k.a HPACK).
https://tools.ietf.org/html/rfc7541

This implementation was originally used in my HTTP/2 client, h2cli, but I separated its HPACK part from it as a library to use it in my QUIC implementation.

Its compatibility is verified with well-known implementations in [http2jp/hpack-test-case](https://github.com/http2jp/hpack-test-case/).

# API

## Encode

```
var HPACK   = require('hpack'),
    codec   = new HPACK(),
    headers = [
        [':scheme', 'http'],
        [':path', '/'],
    ],
    packed  = codec.encode(headers);
-----
<Buffer 86 84>
```

## Decode

```
var HPACK   = require('hpack'),
    codec   = new HPACK(),
    packed  = new Buffer([0x86, 0x84]),
    headers = codec.decode(packed);
-----
[ [ ':scheme', 'http' ], [ ':path', '/' ] ]
```

## Change dynamic table size

```
var HPACK   = require('hpack'),
    codec   = new HPACK();
codec.setTableSize(512);
```

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