curl-trace-parser is a Node.js package designed to parse the output generated by the `curl` command-line tool when using its `--trace` or `--trace-ascii` options. It extracts raw HTTP request and response messages from curl's custom trace format, which otherwise presents data in fragmented chunks. This utility is particularly useful for debugging or introspecting HTTP communication of RESTful APIs without resorting to lower-level tools like tcpdump or Wireshark. It offers output in a raw HTTP message format or an API Blueprint format. The package is at version 0.0.10 and appears to be abandoned, with no recent updates or a clear release cadence. Its key differentiator is simplifying the often complex task of interpreting curl's trace output into structured HTTP messages.
npm install curl-trace-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic usage of `curl-trace-parser` by reading a mock trace file, feeding its lines to the parser's `execute` method, listening for 'request' and 'response' events, and piping the parser's transformed output to a custom stream to collect the raw HTTP messages.
Due to its pre-1.0 status and apparent abandonment, consider this package for experimental use only. Avoid in production systems where stability is critical, or be prepared to fork and maintain it yourself.
Thoroughly test compatibility with your Node.js version and cURL output. If you encounter issues, you will likely need to debug and fix them yourself or seek alternative solutions.
Always import using `const parser = require('curl-trace-parser');` to get the pre-instantiated parser instance. Listen to events like `parser.on('request', ...)` and `parser.on('response', ...)`.Regularly verify parser output with your specific cURL version if relying on this tool in a critical workflow. Be prepared for manual adjustments or to find alternatives if cURL's trace format evolves.
The package exports a pre-instantiated `EventEmitter` instance directly. Use `const parser = require('curl-trace-parser');` and then `parser.on(...)`.Ensure `parser.end()` is called only after all trace lines have been processed by `parser.execute(line)` to correctly signal the end of input.
Run `npm install curl-trace-parser` in your project directory, or `npm install -g curl-trace-parser` if you intend to use its CLI globally.
No dependency data recorded yet.