Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    format-responsepublic

    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

    install

    npm i format-response

    Downloadslast 7 days

    1

    version

    0.4.2

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar