Gathering detailed insights and metrics for got-fetch
Gathering detailed insights and metrics for got-fetch
Gathering detailed insights and metrics for got-fetch
Gathering detailed insights and metrics for got-fetch
npm install got-fetch
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
21 Stars
458 Commits
4 Forks
3 Watching
3 Branches
4 Contributors
Updated on 25 Nov 2024
TypeScript (96%)
JavaScript (4%)
Cumulative downloads
Total Downloads
Last day
-3.8%
5,069
Compared to previous day
Last week
8.9%
28,471
Compared to previous week
Last month
9.7%
109,308
Compared to previous month
Last year
131%
1,056,079
Compared to previous year
1
19
A fetch
-compatible wrapper around got for those times when you need to
fetch stuff over HTTP 😉
Why would you use this instead of got? Sometimes you might need a fetch
wrapper and this is it (e.g. Apollo uses fetch
to query remote schemas).
If you're using on NodeJS v18 or greater than you should be using its global fetch. It's better integrated, better supported and has more features.
Support table:
got-fetch version | works with got version | Notes |
---|---|---|
^5.0.0 | ^12.0.0 | ESM package. You have to use import |
^4.0.0 | ^11.0.0 | CJS package. You can use require |
got
is a peer dependency so you will need to install it alongside got-fetch
:
1npm install --save got got-fetch
For CommonJS support, we maintain v4 of this package.
Use the default export:
1import fetch from 'got-fetch'; 2 3// in ESM we can use top-level await 4const resp = await fetch('https://example.com'); 5 6console.log(resp.status); // 200 7console.log(await resp.text()); // a HTML document
The module also exports a function which allows you to use your own custom
got
instance:
1import got from 'got'; 2import { createFetch } from 'got-fetch'; 3 4const myGot = got.extend({ 5 headers: { 6 'x-api-key': 'foo bar' 7 } 8}); 9 10const fetch = createFetch(myGot); 11 12// this request will send the header `x-api-key: foo bar` 13fetch('https://example.com');
fetch
is designed for browser environments and this package is just a wrapper
around a Node-based HTTP client. Not all fetch
features are supported:
no-cors
, same-origin
, navigate
only-if-cached
error
, manual
default
) will use got's caching algorithm
(any other value will disable caching)See LICENSE for information.
No vulnerabilities found.
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/1 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More