# node-superfetch

> A wrapper for Node.js' fetch API that makes it appear like superagent.

Latest version **0.3.5** (published 2025-04-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install node-superfetch
pnpm add node-superfetch
yarn add node-superfetch
bun add node-superfetch
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.5 |
| Published | 2025-04-21 |
| First published | 2018-06-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 2 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | lilyissillyyy |
| Maintainers | lilyissillyyy |
| Keywords | fetch, node-fetch, superagent, snekfetch, request, http, https |

## Links

- npm: https://www.npmjs.com/package/node-superfetch
- Repository: https://github.com/lilyissillyyy/node-superfetch
- Homepage: https://github.com/lilyissillyyy/node-superfetch#readme
- Issues: https://github.com/lilyissillyyy/node-superfetch/issues
- npm.io page: https://npm.io/package/node-superfetch

## Dependencies (2)

- [form-data](https://npm.io/package/form-data.md) ^4.0.2
- [arraybuffer-to-buffer](https://npm.io/package/arraybuffer-to-buffer.md) ^0.0.7

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.3.5 (latest) — 2025-04-21
- 0.3.4 — 2024-03-24
- 0.3.3 — 2022-10-12
- 0.3.2 — 2022-10-02
- 0.3.1 — 2022-10-01
- 0.3.0 — 2022-09-18
- 0.2.3 — 2021-05-01
- 0.2.2 — 2021-04-04
- 0.2.1 — 2021-04-04
- 0.2.0 — 2021-04-04
- 0.1.11 — 2021-02-01
- 0.1.10 — 2020-01-23
- 0.1.9 — 2018-10-01
- 0.1.8 — 2018-10-01
- 0.1.7 — 2018-09-27
- … 11 more at https://npm.io/package/node-superfetch/versions

## README

# node-superfetch
[![Downloads](https://img.shields.io/npm/dt/node-superfetch.svg?maxAge=3600)](https://www.npmjs.com/package/node-superfetch)
[![Version](https://img.shields.io/npm/v/node-superfetch.svg?maxAge=3600)](https://www.npmjs.com/package/node-superfetch)

node-superfetch is a tiny little wrapper for Node.js' fetch API that makes it
look like you are using [superagent](https://www.npmjs.com/package/superagent).

## Basic Usage
```js
const request = require('node-superfetch');

try {
	const { body } = await request.get('https://registry.npmjs.com/node-superfetch');
	console.log(body);
} catch (err) {
	console.error(err);
}
```
Usage is basically that of superagent or snekfetch, and implements the same HTTP
methods, as well as functions like `query` (sets query parameters), `set` (sets
headers), `send` (for adding POST data and such), `attach` (for sending
FormData), `redirects` (for setting the allowed number of redirects), and
`agent` (for setting the HTTP agent). `end` is also supported for callbacks.

Additionally, you can also use the `noResultData` option to get everything
except the actual result data of the request. This is essentially doing the
request without calling any methods to parse the result data.

```js
const { headers, url } = await request.get('https://registry.npmjs.com/node-superfetch', { noResultData: true });
console.log(url); // should log https://registry.npmjs.com/node-superfetch
```

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