format-response

0.4.2 • Public • Published

format-response

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

Installation

npm install format-response

Usage

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

Options

format(options)

ignoreHeaders

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

prettifyJSON

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

printRequestHeader

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

ignoreBody

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

Running Tests

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

License

(The MIT License)

Copyright 2014 Cameron Lakenen

Dependents (1)

Package Sidebar

Install

npm i format-response

Weekly Downloads

10

Version

0.4.2

License

MIT

Last publish

Collaborators

  • lakenen