{"_id":"curl-trace-parser","_rev":"32-a3682dc2d047b0a8e1c2897fdf9f38ac","name":"curl-trace-parser","description":"Parse curl --trace option output to raw HTTP message","dist-tags":{"latest":"0.0.10"},"versions":{"0.0.2":{"name":"curl-trace-parser","version":"0.0.2","description":"Parse curl --trace option output to raw HTTP message","main":"lib/index.js","scripts":{"test":"mocha --reporter spec --compilers 'coffee:coffee-script' ./test/**/*-test.coffee","prepublish":"scripts/build"},"bin":{"curl-trace-parser":"bin/curl-trace-parser"},"dependencies":{"commander":"1.2.0"},"devDependencies":{"coffee-script":"1.6.3","mocha":"1.11.0","chai":"1.7.1"},"keywords":["curl","parse","trace","raw","http","message","request","repsponse"],"author":{"name":"Adam Kliment","email":"adam@apiary.io"},"license":"MIT","repository":{"type":"git","url":"git://github.com/apiaryio/curl-trace-parser.git"},"homepage":"https://github.com/apiaryio/curl-trace-parser","_id":"curl-trace-parser@0.0.2","dist":{"shasum":"e764823293e48230cd433d03c872d3b42ba07e6e","tarball":"https://registry.npmjs.org/curl-trace-parser/-/curl-trace-parser-0.0.2.tgz","integrity":"sha512-7WSR1xdLux88anflFi7aFh2Lbmq25KMGynHz8/QBW+k//obTs2OgeYnql0hAgdOROoQWVt59osRFmk7WJ4sG6A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDD4Nm49Sa/w8vc7xenWJ3Q3E4v9G9bRXbHfciIHZlgrAiEAm/E2ufp6s1Xymn5vSyv6b7f/+OShzx+c4PuWSFKeEbg="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"netmilk","email":"adam@apiary.io"},"maintainers":[{"name":"netmilk","email":"adam@apiary.io"}],"directories":{}},"0.0.3":{"name":"curl-trace-parser","version":"0.0.3","description":"Parse curl --trace option output to raw HTTP message","main":"lib/parser.js","scripts":{"test":"mocha --reporter spec --compilers 'coffee:coffee-script' ./test/**/*-test.coffee","prepublish":"scripts/build"},"bin":{"curl-trace-parser":"bin/curl-trace-parser"},"dependencies":{"commander":"1.2.0"},"devDependencies":{"coffee-script":"1.6.3","mocha":"1.11.0","chai":"1.7.1"},"keywords":["curl","parse","trace","raw","http","message","request","repsponse"],"author":{"name":"Adam Kliment","email":"adam@apiary.io"},"license":"MIT","repository":{"type":"git","url":"git://github.com/apiaryio/curl-trace-parser.git"},"homepage":"https://github.com/apiaryio/curl-trace-parser","_id":"curl-trace-parser@0.0.3","dist":{"shasum":"8d5cfe64296b7852dfb2cd7e42f2057b1cf235f4","tarball":"https://registry.npmjs.org/curl-trace-parser/-/curl-trace-parser-0.0.3.tgz","integrity":"sha512-87yeUHZyGPQYhD6lCD+7k5ZQETanE3D3Tq6uPnZidBIA1/Z5hF9TmOqJ3tUupOfxhiVhtOfthyaER3DGIAUjTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxNl+6HvxRFQW6C3t1+83Vo0GT0b/bB8cEY4ke2oXnswIgYkcyU6zVs5DmfgEtM5JTH38fAjerVkE/z32OTQ6mysQ="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"netmilk","email":"adam@apiary.io"},"maintainers":[{"name":"netmilk","email":"adam@apiary.io"}],"directories":{}},"0.0.5":{"name":"curl-trace-parser","version":"0.0.5","description":"Parse curl --trace option output to raw HTTP message","main":"lib/parser.js","scripts":{"test":"scripts/test","prepublish":"scripts/prepublish"},"bin":{"curl-trace-parser":"bin/curl-trace-parser"},"dependencies":{"commander":"1.2.0"},"devDependencies":{"coffee-script":"1.6.3","mocha":"1.11.0","chai":"1.7.1"},"keywords":["curl","parse","trace","raw","http","message","request","repsponse"],"author":{"name":"Adam Kliment","email":"adam@apiary.io"},"license":"MIT","repository":{"type":"git","url":"git://github.com/apiaryio/curl-trace-parser.git"},"homepage":"https://github.com/apiaryio/curl-trace-parser","_id":"curl-trace-parser@0.0.5","dist":{"shasum":"cc3ab985b7714ac3600d9b95995efd9362caef55","tarball":"https://registry.npmjs.org/curl-trace-parser/-/curl-trace-parser-0.0.5.tgz","integrity":"sha512-I8vWqCaMCx3+6hnv2OYxPW3UyC6tPvhs6Ag9Oo4hReDD+47Zwske3/NEoBEHnOmgDcefNcTBhoKGVO3s339YEQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDILYumiLqctSFiarJsvkY6ygTgCIcQXpPeyxXXlHaupAIgFUqDQfb7STCaWiGE8WjrMeYijpVnKhJQ/8iP/bUKXZs="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"netmilk","email":"adam@apiary.io"},"maintainers":[{"name":"netmilk","email":"adam@apiary.io"}],"directories":{}},"0.0.6":{"name":"curl-trace-parser","version":"0.0.6","description":"Parse curl --trace option output to raw HTTP message","main":"lib/parser.js","scripts":{"test":"scripts/test","prepublish":"scripts/prepublish"},"bin":{"curl-trace-parser":"bin/curl-trace-parser"},"dependencies":{"commander":"1.2.0"},"devDependencies":{"coffee-script":"1.6.3","mocha":"1.11.0","chai":"1.7.1"},"keywords":["curl","parse","trace","raw","http","message","request","repsponse"],"author":{"name":"Adam Kliment","email":"adam@apiary.io"},"license":"MIT","repository":{"type":"git","url":"git://github.com/apiaryio/curl-trace-parser.git"},"homepage":"https://github.com/apiaryio/curl-trace-parser","_id":"curl-trace-parser@0.0.6","dist":{"shasum":"f21266439da9217f0fbc04a83e7ca3da51a347f9","tarball":"https://registry.npmjs.org/curl-trace-parser/-/curl-trace-parser-0.0.6.tgz","integrity":"sha512-wr9+SHjxes673T84Z8TLmtyFJ/HtxfWL3cL88S8ofi+KhpyaL6p1R4ex6+K73ScKICg6TCrTeQ6mLyC/uCN3gw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXb9TnC9k10uQiaM0PfZ9z2Pp+7LFS5CdUCyE0qTwt6wIgX/FxYgWoTtEOHs1FmZdf6Ov621eJRQNfC7ZUk5WSUoA="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"netmilk","email":"adam@apiary.io"},"maintainers":[{"name":"netmilk","email":"adam@apiary.io"}],"directories":{}},"0.0.7":{"name":"curl-trace-parser","version":"0.0.7","description":"Parse curl --trace option output to raw HTTP message","main":"lib/parser.js","scripts":{"test":"scripts/test","prepublish":"scripts/prepublish"},"bin":{"curl-trace-parser":"bin/curl-trace-parser"},"dependencies":{"commander":"1.2.0"},"devDependencies":{"coffee-script":"1.6.3","mocha":"1.11.0","chai":"1.7.1"},"keywords":["curl","parse","trace","raw","http","message","request","repsponse"],"author":{"name":"Adam Kliment","email":"adam@apiary.io"},"license":"MIT","repository":{"type":"git","url":"git://github.com/apiaryio/curl-trace-parser.git"},"homepage":"https://github.com/apiaryio/curl-trace-parser","_id":"curl-trace-parser@0.0.7","dist":{"shasum":"92a1199ffa75c8c45dda3626709e01e81cfde9c8","tarball":"https://registry.npmjs.org/curl-trace-parser/-/curl-trace-parser-0.0.7.tgz","integrity":"sha512-a8K8+7ITMBVH+KknOTih18nwN65qEJafSm9B6U5JvqxFDAXlKRW3rKwjbpJ0W6n+SKYX/Er8h9lyq6Bl+XR8Fg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzkQ5SpsM+w4bCua+l3AUL8WeqHK4ptNIJUd83eggIjAIhALv1IbqYOMvv+Vobe1R7tB1oU4Kjew0a9W6d8DoItPWS"}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"netmilk","email":"adam@apiary.io"},"maintainers":[{"name":"netmilk","email":"adam@apiary.io"}],"directories":{}},"0.0.8":{"name":"curl-trace-parser","version":"0.0.8","description":"Parse curl --trace option output to raw HTTP message","main":"lib/parser.js","scripts":{"test":"scripts/test","prepublish":"scripts/prepublish"},"bin":{"curl-trace-parser":"bin/curl-trace-parser"},"dependencies":{"commander":"1.2.0","api-blueprint-http-formatter":"0.0.1","http-string-parser":"0.0.4"},"devDependencies":{"coffee-script":"1.6.3","mocha":"1.11.0","chai":"1.7.1"},"keywords":["curl","parse","trace","raw","http","message","request","repsponse","api","blueprint","apiary"],"author":{"name":"Adam Kliment","email":"adam@apiary.io"},"license":"MIT","repository":{"type":"git","url":"git://github.com/apiaryio/curl-trace-parser.git"},"homepage":"https://github.com/apiaryio/curl-trace-parser","bugs":{"url":"https://github.com/apiaryio/curl-trace-parser/issues"},"_id":"curl-trace-parser@0.0.8","dist":{"shasum":"8420f4890fd998822fb4b48bfd667123e029370b","tarball":"https://registry.npmjs.org/curl-trace-parser/-/curl-trace-parser-0.0.8.tgz","integrity":"sha512-O5IESydoDwZrpUaLlRHD/bORE2xVcPo56V6uSrk/3aj9HkSrZDM4WG+tU1Ismkbs/QnEnm8tksN3eyYUDUNbUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVeauvyvOV9dhE4uUM+L5pdCepVKlccTLiyL03SKoCowIhAM0NHmBnQIaPtiRahPpgFzRfhxJICflTTyuMZlIiALWU"}]},"_from":".","_npmVersion":"1.3.4","_npmUser":{"name":"netmilk","email":"adam@apiary.io"},"maintainers":[{"name":"netmilk","email":"adam@apiary.io"}],"directories":{}},"0.0.9":{"name":"curl-trace-parser","version":"0.0.9","description":"Parse curl --trace option output to raw HTTP message","main":"lib/parser.js","scripts":{"test":"scripts/test","prepublish":"scripts/prepublish"},"bin":{"curl-trace-parser":"bin/curl-trace-parser"},"dependencies":{"commander":"2.11.0","api-blueprint-http-formatter":"0.0.1","http-string-parser":"0.0.6"},"devDependencies":{"coffee-script":"1.6.3","mocha":"1.11.0","chai":"1.7.1"},"keywords":["curl","parse","trace","raw","http","message","request","repsponse","api","blueprint","apiary"],"author":{"name":"Adam Kliment","email":"adam@apiary.io"},"license":"MIT","repository":{"type":"git","url":"git://github.com/apiaryio/curl-trace-parser.git"},"homepage":"https://github.com/apiaryio/curl-trace-parser","gitHead":"1c7a7d0a636b28d79854ed666002c569291f324c","bugs":{"url":"https://github.com/apiaryio/curl-trace-parser/issues"},"_id":"curl-trace-parser@0.0.9","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"honzajavorek","email":"mail@honzajavorek.cz"},"dist":{"integrity":"sha512-DxLfcGMGzT7ROw4nktKV8sRJJBvzIH3zx9r8t39l3gF2tQVxzJdKwp1hSHefIGerQy++wQTNP9cn5QS5TcWTJw==","shasum":"2385f37105f859b05953c31215bfd9755fa4ed57","tarball":"https://registry.npmjs.org/curl-trace-parser/-/curl-trace-parser-0.0.9.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzsC6RTGuG7JZBM7wJhrB/vPzELRrUt3Ufmt3MTw12qAiEAr/ZoLk7gltG6dEk5/eVYKz7lgOxJaNY2zBlBynURiu4="}]},"maintainers":[{"email":"mail@honzajavorek.cz","name":"honzajavorek"},{"email":"sre@apiary.io","name":"apiary-sre"},{"email":"adam@netmilk.net","name":"netmilk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/curl-trace-parser-0.0.9.tgz_1511262931533_0.7244890732690692"},"directories":{}},"0.0.10":{"name":"curl-trace-parser","version":"0.0.10","description":"Parse curl --trace option output to raw HTTP message","main":"lib/parser.js","engines":{"node":">= 4"},"scripts":{"test":"scripts/test","prepublish":"scripts/prepublish"},"bin":{"curl-trace-parser":"bin/curl-trace-parser"},"dependencies":{"commander":"2.14.1","api-blueprint-http-formatter":"0.0.1","http-string-parser":"0.0.6"},"devDependencies":{"chai":"4.1.2","coffeescript":"1.12.7","mocha":"5.0.2"},"keywords":["curl","parse","trace","raw","http","message","request","repsponse","api","blueprint","apiary"],"author":{"name":"Adam Kliment","email":"adam@apiary.io"},"license":"MIT","repository":{"type":"git","url":"git://github.com/apiaryio/curl-trace-parser.git"},"homepage":"https://github.com/apiaryio/curl-trace-parser","gitHead":"200eca2e916801867aa8d4d2f63c6bce20dd65c9","bugs":{"url":"https://github.com/apiaryio/curl-trace-parser/issues"},"_id":"curl-trace-parser@0.0.10","_shasum":"c897cce44e607f3105da4b5c08c86542d07bf6a5","_from":".","_npmVersion":"4.6.1","_nodeVersion":"6.11.2","_npmUser":{"name":"honzajavorek","email":"mail@honzajavorek.cz"},"dist":{"shasum":"c897cce44e607f3105da4b5c08c86542d07bf6a5","tarball":"https://registry.npmjs.org/curl-trace-parser/-/curl-trace-parser-0.0.10.tgz","fileCount":20,"unpackedSize":30264,"integrity":"sha512-YTKA9d6TkiQZpDM9rdewlGAKgcLbgofmqRGqzD1hsa3zjVeSDJ0X7O1EztUrWsF3tVG9yMFq44dmQ/TMtEpMCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9Pr4BU/YnHNoggO9Pep6URrd19sML4RmhU9qalXJovAiEAsJw/j6UQfIKonQzoIAdDkv3jsBJY2JPL2BPifmqlnVU="}]},"maintainers":[{"email":"sre@apiary.io","name":"apiary-sre"},{"email":"mail@honzajavorek.cz","name":"honzajavorek"},{"email":"adam@netmilk.net","name":"netmilk"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/curl-trace-parser_0.0.10_1520335547209_0.010209866173985116"},"_hasShrinkwrap":false}},"readme":"# The `curl --trace` parser\n\n[![NPM Version](https://img.shields.io/npm/v/curl-trace-parser.svg)](https://www.npmjs.com/package/curl-trace-parser)\n[![Build Status](https://travis-ci.org/apiaryio/curl-trace-parser.svg)](https://travis-ci.org/apiaryio/curl-trace-parser)\n[![Dependency Status](https://david-dm.org/apiaryio/curl-trace-parser.svg)](https://david-dm.org/apiaryio/curl-trace-parser)\n[![devDependency Status](https://david-dm.org/apiaryio/curl-trace-parser/dev-status.svg)](https://david-dm.org/apiaryio/curl-trace-parser?type=dev)\n[![Greenkeeper badge](https://badges.greenkeeper.io/apiaryio/curl-trace-parser.svg)](https://greenkeeper.io/)\n\n\n## The story\n\nDid you know that you can record raw HTTP communication of [Curl command-line tool](http://curl.haxx.se/docs/manpage.html) with the `--trace` and `--trace-ascii` option? It's the only way I know to get raw HTTP communication without using the [`tcpdump`](http://www.tcpdump.org/) or [`wireshark`](http://www.wireshark.org/).\nFor example, this trick is very useful for the proper introspection into HTTP communication of an undocumented RESTful API.\n\nThe only glitch is that cURL `--trace` saves data in [its custom format][gist], 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.\n\n[gist]: https://gist.github.com/netmilk/6048533\n\n## Usage\n\n```\n$ curl --trace - http://httpbin.org/ip | curl-trace-parser\n```\n\n## Sample API\n\nWe will be using this [sample API][apiarydoc] created with the [Apiary.io mock server](http://apiary.io) to demonstrate tracing an HTTP communication and the use of the cURL trace parser.\n\n[apiarydoc]: http://docs.curltraceparser.apiary.io/\n\n## Install the cURL trace parser\n\n```bash\n$ npm install -g curl-trace-parser\n```\n\n## Record your first trace file\n\n```bash\n$ curl --trace tracefile --header \"Content-Type: application/json\" \\\n--request POST \\\n--data-binary \"{ \\\"product\\\":\\\"1AB23ORM\\\", \\\"quantity\\\": 2 }\" \\\n\"http://curltraceparser.apiary.io/shopping-cart\"\n```\n\nNote this cURL example is copied and pasted from [Apiary interactive API documentation][example].\n\n[example]: http://docs.curltraceparser.apiary.io/#get-%2Fshopping-cart\n\n## Examples\n\n### `--raw` format\n\nThe output is ASCII representation of a raw [HTTP message][message] with few modifications:\n\n- Request line begins with `> `\n- Response line begins with `< `\n- Request and Response is delimited by CR+LF\n- Both Request and Response are terminated by an extra trailing LF\n\nNote: This is little bit tricky because HTTP RFC does not have declared delimiter for Request and Response, for obvious reasons.\n\n```bash\n$ cat tracefile | curl-trace-parser --raw\n> POST /shopping-cart HTTP/1.1\n> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5\n> Host: curltraceparser.apiary.io\n> Accept: */*\n> Content-Type: application/json\n> Content-Length: 39\n>\n> { \"product\":\"1AB23ORM\", \"quantity\": 2 }\n\n< HTTP/1.1 201 Created\n< Content-Type: application/json\n< Date: Tue, 30 Jul 2013 11:32:30 GMT\n< X-Apiary-Ratelimit-Limit: 120\n< X-Apiary-Ratelimit-Remaining: 119\n< Content-Length: 50\n< Connection: keep-alive\n<\n< { \"status\": \"created\", \"url\": \"/shopping-cart/2\" }\n```\n\n### `--blueprint` format\n\nThe output is HTTP Request and Response in the [API blueprint format](http://apiblueprint.org) which is the superset of markdown.\n\n```\n$ cat tracefile | ./bin/curl-trace-parser --blueprint\n# POST /shopping-cart\n+ Request\n    + Headers\n\n            User-Agent:curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x zlib/1.2.5\n            Host:curltraceparser.apiary.io\n            Accept:*/*\n            Content-Type:application/json\n            Content-Length:39\n\n    + Body\n\n            { \"product\":\"1AB23ORM\", \"quantity\": 2 }\n\n+ Response 201\n    + Headers\n\n            Content-Type:application/json\n            Date:Tue, 30 Jul 2013 11:32:30 GMT\n            X-Apiary-Ratelimit-Limit:120\n            X-Apiary-Ratelimit-Remaining:119\n            Content-Length:50\n            Connection:keep-alive\n\n    + Body\n\n            { \"status\": \"created\", \"url\": \"/shopping-cart/2\" }\n\n```\n\nNote: This format does not expect any CR+LF in the message body\n\n### Parse the trace to raw HTTP file using Node.JS\n\n```javascript\nvar fs = require('fs');\nvar parser = require('curl-trace-parser');\nfs.readFile('./tracefile', 'utf8', function (err,trace) {\n  console.log(parser.parse(trace));\n})\n```\n\n## Output format reverse parser\n\n```javascript\nvar fs = require('fs');\nvar parser = require('curl-trace-parser');\nfs.readFile('./tracefile', 'utf8', function (err,trace) {\n  console.log(parser.parseBack(trace));\n})\n```\n\n## API Reference\n\n`parse(traceString)` - parse string with trace to object with raw request and response\n\n`parseToString(traceString)` - parse string with trace to [output format]\n\n`parseBack(outputString)` - parse string with [output format] back to object with raw request an resposne\n\n\n[output format]: https://github.com/apiaryio/curl-trace-parser#output-format\n[message]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html\n\n","maintainers":[{"email":"sre@apiary.io","name":"apiary-sre"}],"time":{"modified":"2022-06-14T05:56:33.368Z","created":"2013-07-21T11:54:11.664Z","0.0.2":"2013-07-21T11:54:14.756Z","0.0.3":"2013-07-21T12:38:33.826Z","0.0.5":"2013-07-21T12:52:59.025Z","0.0.6":"2013-07-23T09:18:03.170Z","0.0.7":"2013-07-23T16:16:31.057Z","0.0.8":"2013-07-30T11:56:17.669Z","0.0.9":"2017-11-21T11:15:31.760Z","0.0.10":"2018-03-06T11:25:47.291Z"},"author":{"name":"Adam Kliment","email":"adam@apiary.io"},"repository":{"type":"git","url":"git://github.com/apiaryio/curl-trace-parser.git"},"homepage":"https://github.com/apiaryio/curl-trace-parser","keywords":["curl","parse","trace","raw","http","message","request","repsponse","api","blueprint","apiary"],"bugs":{"url":"https://github.com/apiaryio/curl-trace-parser/issues"},"license":"MIT","readmeFilename":"README.md"}