🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

log-that-http

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

log-that-http

Logs outgoing http requests and responses.

1.0.1
latest
Source
npm
Version published
Weekly downloads
1.7K
-33.73%
Maintainers
1
Weekly downloads
 
Created
Source

log-that-http

Logs outgoing http requests and responses from Node.js.

Features

  • Writes each outgoing request and response to console.log
  • request and response headers can be included
  • request body can be included
  • Zero dependencies
  • Wide support for popular request libraries
  • Node.js supported from version 8 upwards

Demo

npm install log-that-http axios node-fetch

node --require log-that-http -e "const axios=require('axios').default; axios.get('http://www.google.com');"

LOG_THAT_HTTP_HEADERS=true node --require log-that-http -e "const fetch=require('node-fetch').default; fetch('http://www.github.com');"

Usage

node --require log-that-http foo.js or use require('log-that-http') from within your script.

Use the following environment variables to add more info:

  • LOG_THAT_HTTP_HEADERS=true to log all request and response headers.
  • LOG_THAT_HTTP_BODY=true to log request bodies.

Compatibility

log-that-http is compatible with the popular request libraries and the built-in http and https-modules.

  • axios
  • got
  • node-fetch
  • request
  • superagent
  • http.get() and http.request()
  • https.get() and https.request()

Compatibility with Node.js versions from 8 to 11 is tested with the help of npx & node.

Missing something? Please file an issue.

FAQs

Package last updated on 05 Jan 2019

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