Socket
Socket
Sign inDemoInstall

log-that-http

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    log-that-http

Logs outgoing http requests and responses.


Version published
Maintainers
1
Install size
6.57 kB
Created

Readme

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

Last updated on 05 Jan 2019

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc