Package Exports
- print-response
- print-response/dist/print-response.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (print-response) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
print-response
Print beautified Fastify inject-response in terminal. Color indication of http-status and http-method, brief representation of massive body, optional headers output.
app.inject({ method: 'GET', url: 'sample/users' }).then(response => {printResponse(response, {showHeaders: true})})

app.inject({ method: 'GET', url: 'sample/users/2' }).then(printResponse)

app.inject({ method: 'GET', url: 'sample/usersZZ' }).then(printResponse)

Usage
import app from "./fastify-app";
import printResponse from 'print-response';
app.inject({ method: 'GET', url: 'sample/users/2' }).then(printResponse)
// with async/await
main();
async function main(){
response = await app.inject({ method: 'GET', url: 'sample/users' })
printResponse(response, {showHeaders: true})
}