# @helia/bitswap

> JavaScript implementation of the Bitswap data exchange protocol used by Helia

Latest version **4.0.15** (published 2026-09-10) · Apache-2.0 OR MIT license · 0 weekly downloads

## Install

```sh
npm install @helia/bitswap
pnpm add @helia/bitswap
yarn add @helia/bitswap
bun add @helia/bitswap
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

Negative: declining downloads.

## Facts

| | |
|---|---|
| Version | 4.0.15 |
| Published | 2026-09-10 |
| First published | 2024-04-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 OR MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 26 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1345 |
| Maintainers | npm-service-account-ipfs, achingbrain |
| Keywords | exchange, ipfs, libp2p, p2p |

## Links

- npm: https://www.npmjs.com/package/@helia/bitswap
- Repository: https://github.com/ipfs/helia
- Homepage: https://github.com/ipfs/helia/tree/main/packages/bitswap#readme
- Issues: https://github.com/ipfs/helia/issues
- npm.io page: https://npm.io/package/@helia/bitswap

## Dependencies (26)

- [it-map](https://npm.io/package/it-map.md) ^3.1.6
- [it-take](https://npm.io/package/it-take.md) ^3.0.11
- [p-defer](https://npm.io/package/p-defer.md) ^4.0.1
- [it-drain](https://npm.io/package/it-drain.md) ^3.0.12
- [any-signal](https://npm.io/package/any-signal.md) ^4.2.0
- [race-event](https://npm.io/package/race-event.md) ^1.6.1
- [it-pushable](https://npm.io/package/it-pushable.md) ^3.2.4
- [uint8arrays](https://npm.io/package/uint8arrays.md) ^6.1.1
- [@helia/utils](https://npm.io/package/@helia/utils.md) ^3.0.5
- [it-to-buffer](https://npm.io/package/it-to-buffer.md) ^5.0.0
- [multiformats](https://npm.io/package/multiformats.md) ^14.0.0
- [uint8-varint](https://npm.io/package/uint8-varint.md) ^3.0.0
- [@helia/libp2p](https://npm.io/package/@helia/libp2p.md) ^2.1.3
- [@libp2p/utils](https://npm.io/package/@libp2p/utils.md) ^7.2.2
- [@libp2p/logger](https://npm.io/package/@libp2p/logger.md) ^6.2.8
- [uint8arraylist](https://npm.io/package/uint8arraylist.md) ^3.0.2
- [@libp2p/peer-id](https://npm.io/package/@libp2p/peer-id.md) ^6.0.10
- [interface-store](https://npm.io/package/interface-store.md) ^8.0.0
- [progress-events](https://npm.io/package/progress-events.md) ^1.1.0
- [protons-runtime](https://npm.io/package/protons-runtime.md) ^7.1.0
- [@helia/interface](https://npm.io/package/@helia/interface.md) ^7.1.1
- [@libp2p/interface](https://npm.io/package/@libp2p/interface.md) ^3.2.3
- [it-length-prefixed](https://npm.io/package/it-length-prefixed.md) ^11.0.1
- [interface-blockstore](https://npm.io/package/interface-blockstore.md) ^7.0.1
- [@multiformats/multiaddr](https://npm.io/package/@multiformats/multiaddr.md) ^13.0.3
- [@libp2p/peer-collections](https://npm.io/package/@libp2p/peer-collections.md) ^7.0.21

## Recent versions

- 4.0.15 (latest) — 2026-09-10
- 4.0.14-16fc74d3 (next) — 2026-09-10
- 4.0.14 — 2026-08-22
- 4.0.13-6c96dd38 — 2026-08-22
- 4.0.13 — 2026-08-21
- 4.0.12-91ed35a4 — 2026-08-21
- 4.0.12 — 2026-08-21
- 4.0.11-dc9e15bc — 2026-08-21
- 4.0.11-ae012cf9 — 2026-08-21
- 4.0.11-cd1c4a76 — 2026-08-20
- 4.0.11 — 2026-08-19
- 4.0.10-c9f35dab — 2026-08-19
- 4.0.10 — 2026-08-15
- 4.0.9-ca4dee6f — 2026-08-15
- 4.0.9-3aeb3977 — 2026-08-15
- … 307 more at https://npm.io/package/@helia/bitswap/versions

## README

# @helia/bitswap

[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/helia.svg?style=flat-square)](https://codecov.io/gh/ipfs/helia)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/helia/main.yml?branch=main\&style=flat-square)](https://github.com/ipfs/helia/actions/workflows/main.yml?query=branch%3Amain)

> JavaScript implementation of the Bitswap data exchange protocol used by Helia

# About

<!--

!IMPORTANT!

Everything in this README between "# About" and "# Install" is automatically
generated and will be overwritten the next time the doc generator is run.

To make changes to this section, please update the @packageDocumentation section
of src/index.js or src/index.ts

To experiment with formatting, please run "npm run docs" from the root of this
repo and examine the changes made.

-->

This module implements the [Bitswap protocol](https://docs.ipfs.tech/concepts/bitswap/) in TypeScript.

It supersedes the older [ipfs-bitswap](https://www.npmjs.com/package/ipfs-bitswap) module with the aim of being smaller, faster, better integrated with libp2p/helia, having fewer dependencies and using standard JavaScript instead of Node.js APIs.

# Install

```console
$ npm i @helia/bitswap
```

## Browser `<script>` tag

Loading this module through a script tag will make its exports available as `HeliaBitswap` in the global namespace.

```html
<script src="https://unpkg.com/@helia/bitswap/dist/index.min.js"></script>
```

# API Docs

- <https://ipfs.github.io/helia/modules/_helia_bitswap.html>

# License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/helia/blob/main/packages/bitswap/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](https://github.com/ipfs/helia/blob/main/packages/bitswap/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

# Contribute

Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia/issues).

Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.

Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

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