format-response

Formats http(s) responses a la curl -i as a duplex stream.

format-response

Formats http(s) responses a la curl -i as a duplex stream.

npm install format-response
var format = require('format-response')
http.get('http://example.com', function (res) {
  res.pipe(format()).pipe(process.stdout)
})

format(options)

Array - list of header names to ignore (case-insensitive). Default: []

boolean - if the response type is 'application/json', prettify the JSON output. Default: false

boolean - print the request header before the response. Default: false

boolean - don't print the response body. Default: false

Make sure you have the development dependencies installed by running npm install, then you should be able to run the tests with npm test.

(The MIT License)

Copyright 2014 Cameron Lakenen