0.3.4 • Published 1 month ago

node-superfetch v0.3.4

Weekly downloads
17,517
License
ISC
Repository
github
Last release
1 month ago

node-superfetch

Downloads Version

node-superfetch is a tiny little wrapper for Node.js' fetch API that makes it look like you are using superagent.

Basic Usage

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.

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
0.3.4

1 month ago

0.3.3

2 years ago

0.3.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.2.3

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.2

3 years ago

0.1.11

3 years ago

0.1.10

4 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago