# rabin-native

> librabin bindings for JavaScript

Latest version **2.0.0** (published 2026-02-12) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install rabin-native
pnpm add rabin-native
yarn add rabin-native
bun add rabin-native
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-02-12 |
| First published | 2019-07-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 850 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Holepunch |
| Maintainers | mafintosh, kasperisager |

## Links

- npm: https://www.npmjs.com/package/rabin-native
- Repository: https://github.com/holepunchto/rabin-native
- Homepage: https://github.com/holepunchto/rabin-native#readme
- Issues: https://github.com/holepunchto/rabin-native/issues
- npm.io page: https://npm.io/package/rabin-native

## Dependencies (1)

- [require-addon](https://npm.io/package/require-addon.md) ^1.1.0

## Recent versions

- 2.0.0 (latest) — 2026-02-12
- 2.0.0-6 — 2026-02-12
- 2.0.0-5 — 2026-02-12
- 2.0.0-4 — 2026-02-12
- 2.0.0-3 — 2026-02-12
- 2.0.0-2 — 2026-02-12
- 2.0.0-1 — 2026-02-12
- 2.0.0-0 — 2026-02-12
- 1.0.1 — 2020-07-01
- 1.0.0 — 2020-06-30
- 0.0.1 — 2019-07-26
- 0.0.0 — 2019-07-26

## README

# rabin-native

<https://github.com/holepunchto/librabin> bindings for JavaScript.

```
npm i rabin-native
```

## Usage

```js
const rabin = require('rabin-native')

const chunker = new rabin.Chunker()
const chunks = []

for (const chunk of chunker.push(shakespeare)) {
  chunks.push(chunk)
}

const chunk = chunker.end()

if (chunk) chunks.push(chunk)
```

## API

#### `const chunker = new Chunker([options])`

Construct a new chunker.

Options include:

```js
options = {
  minSize: 512 * 1024, // 512 KiB
  maxSize: 8 * 1024 * 1024 // 8 MiB
}
```

#### `const iterator = chunker.push(data)`

Push data to the chunker, returning an iterator over the identified chunks.

Each chunk has the following shape:

```js
chunk = {
  // Size of the chunk in bytes
  length,
  // Offset of the chunk within the stream
  offset
}
```

#### `const chunk = chunker.end()`

Finish the chunker, returning the trailing chunk or `null`.

## License

Apache-2.0

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