Gathering detailed insights and metrics for fetch-to-curl
Gathering detailed insights and metrics for fetch-to-curl
Gathering detailed insights and metrics for fetch-to-curl
Gathering detailed insights and metrics for fetch-to-curl
node-fetch
A light-weight module that brings Fetch API to node.js
node-fetch-commonjs
A light-weight module that brings Fetch API to node.js
@inrupt/universal-fetch
A library to access fetch from any JavaScript / TypeScript environment
node-fetch-cjs
A wrapper for node-fetch (a light-weight module that brings Fetch API to node.js) to be used in commonjs environment.
npm install fetch-to-curl
Typescript
Module System
96.8
Supply Chain
85.8
Quality
75.8
Maintenance
100
Vulnerability
100
License
JavaScript (84.45%)
HTML (15.55%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
71 Stars
109 Commits
13 Forks
1 Watchers
2 Branches
8 Contributors
Updated on Feb 10, 2025
Latest Version
0.6.0
Package Id
fetch-to-curl@0.6.0
Unpacked Size
6.78 kB
Size
3.35 kB
File Count
8
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
This module was inspired by http-to-curl. Use it to generate curl requests with the inputs you would usually use for javascripts fetch. However it does not patch any modules like http-to-curl. It is just a wrapper to generate the curl string. This ensures that there are no side effects with your actual usage of fetch.
Also note that the goal of this library is to be as simple and minimal as possible. This also means that there are zero dependencies :tada:
1yarn add fetch-to-curl
or
1npm install fetch-to-curl
1import { fetchToCurl } from 'fetch-to-curl'; 2// or In case there is no support for Es Modules in your environment: 3// const { fetchToCurl } = require("fetch-to-curl") 4 5const url = 'https://jsonplaceholder.typicode.com/posts/1'; 6const options = { 7 headers: { 8 Authorization: "BASIC SOMEBASE64STRING" 9 }, 10 method: 'get' 11}; 12// Log yopur request 13console.log(fetchToCurl(url, options)); 14// Do your request 15fetch(url, options); 16 17// Output 18curl "https://jsonplaceholder.typicode.com/posts/1" -X GET -H "Authorization: BASIC SOMEBASE64STRING" 19 20// You can also pass a single Request object 21console.log(fetchToCurl({ 22 url: "https://jsonplaceholder.typicode.com/posts/1" 23 headers: { 24 Authorization: "BASIC SOMEBASE64STRING" 25 }, 26 method: 'get' 27})); 28 29// and/or a Headers object as you would to with fetch 30console.log(fetchToCurl({ 31 url: "https://jsonplaceholder.typicode.com/posts/1" 32 headers: new Headers({ 33 Authorization: "BASIC SOMEBASE64STRING" 34 }), 35 method: 'get' 36})) 37
There is a minimal example of usage without package manager available which allows to directly test this in the browser console. (view source - playground.html)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
Found 3/5 approved changesets -- score normalized to 6
Reason
6 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
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
Project has not signed or included provenance with any releases.
Details
Score
Last Scanned on 2025-07-07
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