New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

print-response

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

print-response

Terminal output of Fastify http response received by .inject() command

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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})})

fastify.inject() response

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

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

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})
}

Keywords

terminal

FAQs

Package last updated on 11 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts