1.0.2 • Published 3 years ago
tidy-http v1.0.2
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.