tidy-http
v1.0.2
Published
[![Build Status](https://travis-ci.org/markwylde/tidy-http.svg?branch=master)](https://travis-ci.org/markwylde/tidy-http) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/markwylde/tidy-http) [![GitHub package.json version](h
Downloads
5
Readme
tidy-http
The native request and response objects in node's http server contain a lot of information that is not commonly used. This library will return a new object, with only useful fields.
Installation
npm install tidy-http
Example Usage
const { tidyRequest } = require('tidy-http');
const server = http.createServer((request, response) => {
const tidiedRequest = tidyRequest(request);
console.log(tidiedRequest);
})
/*
{
complete: false,
upgrade: false,
aborted: false,
headers: {
host: 'localhost:8000',
connection: 'close'
},
trailers: {},
url: '/',
method: 'GET',
statusCode: null,
statusMessage: null
}
*/
License
This project is licensed under the terms of the MIT license.