Gathering detailed insights and metrics for curl-trace-parser
Gathering detailed insights and metrics for curl-trace-parser
Gathering detailed insights and metrics for curl-trace-parser
Gathering detailed insights and metrics for curl-trace-parser
npm install curl-trace-parser
Typescript
Module System
Min. Node Version
Node Version
NPM Version
84.5
Supply Chain
98.4
Quality
75
Maintenance
100
Vulnerability
100
License
JavaScript (98.74%)
Shell (1.26%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
3,634,963
Last Day
1,669
Last Week
7,422
Last Month
33,641
Last Year
349,752
MIT License
197 Stars
122 Commits
11 Forks
20 Watchers
9 Branches
7 Contributors
Updated on Nov 08, 2024
Minified
Minified + Gzipped
Latest Version
0.0.10
Package Id
curl-trace-parser@0.0.10
Unpacked Size
29.55 kB
Size
8.52 kB
File Count
20
NPM Version
4.6.1
Node Version
6.11.2
Cumulative downloads
Total Downloads
Last Day
26.3%
1,669
Compared to previous day
Last Week
-5.9%
7,422
Compared to previous week
Last Month
13.1%
33,641
Compared to previous month
Last Year
1.7%
349,752
Compared to previous year
3
curl --trace
parserDid you know that you can record raw HTTP communication of Curl command-line tool with the --trace
and --trace-ascii
option? It's the only way I know to get raw HTTP communication without using the tcpdump
or wireshark
.
For example, this trick is very useful for the proper introspection into HTTP communication of an undocumented RESTful API.
The only glitch is that cURL --trace
saves data in its custom format, far from human-friendly, saving chunks as they are being received and splitting them by packets. If you want a human readable form then this parser is what you need. Delivered as a Node.js package.
$ curl --trace - http://httpbin.org/ip | curl-trace-parser
We will be using this sample API created with the Apiary.io mock server to demonstrate tracing an HTTP communication and the use of the cURL trace parser.
1$ npm install -g curl-trace-parser
1$ curl --trace tracefile --header "Content-Type: application/json" \ 2--request POST \ 3--data-binary "{ \"product\":\"1AB23ORM\", \"quantity\": 2 }" \ 4"http://curltraceparser.apiary.io/shopping-cart"
Note this cURL example is copied and pasted from Apiary interactive API documentation.
--raw
formatThe output is ASCII representation of a raw HTTP message with few modifications:
>
<
Note: This is little bit tricky because HTTP RFC does not have declared delimiter for Request and Response, for obvious reasons.
1$ cat tracefile | curl-trace-parser --raw 2> POST /shopping-cart HTTP/1.1 3> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5 4> Host: curltraceparser.apiary.io 5> Accept: */* 6> Content-Type: application/json 7> Content-Length: 39 8> 9> { "product":"1AB23ORM", "quantity": 2 } 10 11< HTTP/1.1 201 Created 12< Content-Type: application/json 13< Date: Tue, 30 Jul 2013 11:32:30 GMT 14< X-Apiary-Ratelimit-Limit: 120 15< X-Apiary-Ratelimit-Remaining: 119 16< Content-Length: 50 17< Connection: keep-alive 18< 19< { "status": "created", "url": "/shopping-cart/2" }
--blueprint
formatThe output is HTTP Request and Response in the API blueprint format which is the superset of markdown.
$ cat tracefile | ./bin/curl-trace-parser --blueprint
# POST /shopping-cart
+ Request
+ Headers
User-Agent:curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5
Host:curltraceparser.apiary.io
Accept:*/*
Content-Type:application/json
Content-Length:39
+ Body
{ "product":"1AB23ORM", "quantity": 2 }
+ Response 201
+ Headers
Content-Type:application/json
Date:Tue, 30 Jul 2013 11:32:30 GMT
X-Apiary-Ratelimit-Limit:120
X-Apiary-Ratelimit-Remaining:119
Content-Length:50
Connection:keep-alive
+ Body
{ "status": "created", "url": "/shopping-cart/2" }
Note: This format does not expect any CR+LF in the message body
1var fs = require('fs'); 2var parser = require('curl-trace-parser'); 3fs.readFile('./tracefile', 'utf8', function (err,trace) { 4 console.log(parser.parse(trace)); 5})
1var fs = require('fs'); 2var parser = require('curl-trace-parser'); 3fs.readFile('./tracefile', 'utf8', function (err,trace) { 4 console.log(parser.parseBack(trace)); 5})
parse(traceString)
- parse string with trace to object with raw request and response
parseToString(traceString)
- parse string with trace to output format
parseBack(outputString)
- parse string with output format back to object with raw request an resposne
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/3 approved changesets -- score normalized to 6
Reason
project is archived
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 2025-03-10
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