# @libp2p/http-fetch

> libp2p-compatible implementation of the fetch API

Latest version **4.0.4** (published 2026-07-03) · Apache-2.0 OR MIT license · 0 weekly downloads

## Install

```sh
npm install @libp2p/http-fetch
pnpm add @libp2p/http-fetch
yarn add @libp2p/http-fetch
bun add @libp2p/http-fetch
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.4 |
| Published | 2026-07-03 |
| First published | 2024-06-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 OR MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 4 |
| Unpacked size | 451.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 13 |
| Maintainers | daviddias, alanshaw, achingbrain, vascosantos, npm-service-account-libp2p, jacobheun |

## Links

- npm: https://www.npmjs.com/package/@libp2p/http-fetch
- Repository: https://github.com/libp2p/js-libp2p-http
- Homepage: https://github.com/libp2p/js-libp2p-http/tree/main/packages/http-fetch#readme
- Issues: https://github.com/libp2p/js-libp2p-http/issues
- npm.io page: https://npm.io/package/@libp2p/http-fetch

## Dependencies (4)

- [uint8arrays](https://npm.io/package/uint8arrays.md) ^6.1.1
- [@libp2p/interface](https://npm.io/package/@libp2p/interface.md) ^3.2.0
- [@libp2p/http-utils](https://npm.io/package/@libp2p/http-utils.md) ^2.0.0
- [@achingbrain/http-parser-js](https://npm.io/package/@achingbrain/http-parser-js.md) ^0.5.9

## Recent versions

- 4.0.4 (latest) — 2026-07-03
- 4.0.3 — 2026-06-14
- 4.0.2 — 2026-04-28
- 4.0.1 — 2025-10-13
- 4.0.0 — 2025-10-02
- 3.0.1 — 2025-05-28
- 3.0.0 — 2025-05-28
- 2.2.2 — 2025-03-26
- 2.2.1 — 2025-03-26
- 2.2.0 — 2025-03-26
- 2.1.1 — 2024-12-11
- 2.1.0 — 2024-11-01
- 2.0.2 — 2024-10-29
- 2.0.1 — 2024-10-29
- 2.0.0 — 2024-10-29
- … 4 more at https://npm.io/package/@libp2p/http-fetch/versions

## README

# @libp2p/http-fetch

[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-http.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-http)
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-http/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/libp2p/js-libp2p-http/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> libp2p-compatible implementation of the fetch API

# 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 is an implementation of the [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
that uses libp2p streams as the underlying transport layer, instead of a TCP
socket.

# Install

```console
$ npm i @libp2p/http-fetch
```

## Browser `<script>` tag

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

```html
<script src="https://unpkg.com/@libp2p/http-fetch/dist/index.min.js"></script>
```

# API Docs

- <https://libp2p.github.io/js-libp2p-http/modules/_libp2p_http-fetch.html>

# License

Licensed under either of

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

# Contribution

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.

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