Gathering detailed insights and metrics for curl-parser-js
Gathering detailed insights and metrics for curl-parser-js
Gathering detailed insights and metrics for curl-parser-js
Gathering detailed insights and metrics for curl-parser-js
parse-curl-js
An better cURL string parser
parse-curl-js-fixed
An better cURL string parser
@diotoborg/molestias-voluptate
Transpile [`curl`](https://en.wikipedia.org/wiki/CURL) commands into C, C#, ColdFusion, Clojure, Dart, Elixir, Go, HTTPie, Java, JavaScript, Julia, Kotlin, Lua, MATLAB, Objective-C, OCaml, Perl, PHP, PowerShell, Python, R, Ruby, Rust, Swift, Wget, Ansible
@diotoborg/beatae-illo
[![Build Status](https://travis-ci.com/diotoborg/beatae-illo.svg?branch=main)](https://travis-ci.com/diotoborg/beatae-illo) [![npm version](https://badge.fury.io/js/%40cospired%2Fi18n-iso-languages.svg)](https://badge.fury.io/js/%40cospired%2Fi18n-iso-lan
npm install curl-parser-js
Typescript
Module System
Node Version
NPM Version
69.4
Supply Chain
94.6
Quality
74.9
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
9,638
Last Day
1
Last Week
16
Last Month
59
Last Year
2,539
17 Stars
17 Commits
6 Forks
2 Watching
1 Branches
2 Contributors
Latest Version
0.0.3
Package Id
curl-parser-js@0.0.3
Size
111.74 kB
NPM Version
5.5.1
Node Version
7.10.0
Cumulative downloads
Total Downloads
Last day
-50%
1
Compared to previous day
Last week
6.7%
16
Compared to previous week
Last month
7.3%
59
Compared to previous month
Last year
-53.8%
2,539
Compared to previous year
Final javascript size is 2.58kB only!!
Simple javascript library to parse cUrl command
to json object
. Regex based matching without adding any complex parser code/library. Can be used in Node
, in any frontend project
or as standalone js file
.
With the generated json object you may construct your own ajax
call using your favourite
library.
Add your script tag
<script src="https://cdn.jsdelivr.net/npm/curl-parser-js@0.0.3/dist/parse-curl.js"></script>
Parse your cmd
const curlCmd = `curl 'http://server.com:5050/a/c/getName/?param1=pradeep¶m2=kumar¶m3=sharma'`;
parse_curl_js.parse(curlCmd);
import Curlparser from 'curl-parser-js';
Assume you have your `cUrl` command as a string constant
const curlCmd = `curl 'http://server.com:5050/a/c/getName'`;
### Execute parser to parse the curl command
const result = parsecurl(curlCmd);
console.log(JSON.stringify(result, null, 2));
will result in
{
"url": "http://server.com:5050/a/c/getName",
"headers": {}
}
const curlCmd = `curl 'http://server.com:5050/a/c/getName/?param1=pradeep¶m2=kumar¶m3=sharma'`;
const result = parsecurl(curlCmd);
console.log(JSON.stringify(result, null, 2));
will result in
{
"url": "http://server.com:5050/a/c/getName/?param1=pradeep¶m2=kumar¶m3=sharma",
"headers": {},
"queryString": {
"param1": "pradeep",
"param2": "kumar",
"param3": "sharma"
}
}
const curlCmd = `curl 'https://exampleserver.com/api/v5/tracktime/' -H 'origin: https://exampleserver.com' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-GB,en-US;q=0.8,en;q=0.6' -H 'authorization: JWT eyJiOjE1MTIyMTIyNzYsIm9yaiOjE1MTIyMTIyNzYsIm9yaJ9.eyJ2ZXJzaW9uIjoiMjciLCJleHAiOjE1MTIyMTIyNzYsIm9yaiOjE1MTIyMTIyNzYsIm9yaLCJ1c2VyX2lkIjo1MTAsImVtYWlsIjoibWFydWRodS5ndW5iOjE1MTIyMTIyNzYsIm9yam5hbWUiOiJtYXJ1ZGh1Lmd1iOjE1MTIyMTIyNzYiOjE1MTIyMTIyNzYsIm9yafQ._BuiOjE1MTIyMTIyNzYsIm9yadJ__2iOjE1MTIyMTIyNzYsIm9yaRTmNcW0' -H 'content-type: application/json; charset=UTF-8' -H 'accept: */*' -H 'referer: https://exampleserver.com/timeSheetChange' -H 'authority: exampleserver.com' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36' --data-binary '{"action":"Add custom time","data":"November 27, 2017 - December 03, 2017"}' --compressed`;
const result = parsecurl(curlCmd);
console.log(JSON.stringify(result, null, 2));
will result in
{
"url": "https://exampleserver.com/api/v5/tracktime/",
"headers": {
"origin": "https",
"accept-encoding": "gzip, deflate, br",
"accept-language": "en-GB,en-US;q=0.8,en;q=0.6",
"authorization": "JWT eyJiOjE1MTIyMTIyNzYsIm9yaiOjE1MTIyMTIyNzYsIm9yaJ9.eyJ2ZXJzaW9uIjoiMjciLCJleHAiOjE1MTIyMTIyNzYsIm9yaiOjE1MTIyMTIyNzYsIm9yaLCJ1c2VyX2lkIjo1MTAsImVtYWlsIjoibWFydWRodS5ndW5iOjE1MTIyMTIyNzYsIm9yam5hbWUiOiJtYXJ1ZGh1Lmd1iOjE1MTIyMTIyNzYiOjE1MTIyMTIyNzYsIm9yafQ._BuiOjE1MTIyMTIyNzYsIm9yadJ__2iOjE1MTIyMTIyNzYsIm9yaRTmNcW0",
"content-type": "application/json; charset=UTF-8",
"accept": "*/*",
"referer": "https",
"authority": "exampleserver.com",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"
},
"body": {
"action": "Add custom time",
"data": "November 27, 2017 - December 03, 2017"
}
}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/9 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
71 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
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