New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

morgan-body

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

morgan-body

morgan logging req, res, and body

  • 0.10.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
decreased by-6.73%
Maintainers
1
Weekly downloads
 
Created
Source

morgan-body

Logging the way you always wanted it to be! Nicely colorized logging that includes Request and Response bodies.

NPM

Example Use

Note: unlike typical express middleware you must pass the actual app into the function

import morganBody from 'morgan-body';
import express from 'express';
import bodyParser from 'body-parser';

const app = express();

// must parse body before morganBody as body will be logged
app.use(bodyParser.json());

// hook morganBody to express app
morganBody(app);
screen shot 2017-07-07 at 2 02 55 am *Note: console output is colorized for iTerm2, might look odd on terminals with other background colors

API

morganBody(<express instance>, <options object>)

Options are:

{
  maxBodyLength: (default: 1000), caps the length of the console output of a single request/response to specified length,

  logDateTime: (default: true), allows disabling of logging request date + time,

  logReqUserAgent: (default: true), allows disabling of logging request user agent,

  logRequestBody: (default: true), allows disabling of logging request body,

  logResponseBody: (default: true), allows disabling of logging response body
}

Keywords

FAQs

Package last updated on 04 Sep 2017

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc