🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

emorlog

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emorlog

An extension of the morgan express logger to output through the debug library.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

emorlog

Emorlog is an express middleware which composes the morgan logger middleware with the pino console output library for a consistent logging output with other library debug info.

Installation

npm install emorlog

Usage

morganDevtool(format,options);

  • format (string): The morgan format string
  • options (object): Optional options to pass through to morgan
import express, { Request, Response } from 'express';
import { morganDevtool, log } from 'emorlog';

const app = express();

app.use(morganDevtool('dev'));

app.get('/', (req: Request, res: Response) => {
  res.status(200).json({ message: 'Hello Emorlog' });
});

app.listen(5000, 'localhost', () => {
  log.info(`Server listing at http://localhost:5000`);
});

example output

image demo

Tokens (extends morgan)

:datetz The current date and time in UTC.

:methodColor The HTTP method of the request.

:statusColor The status code of the response.

Keywords

express

FAQs

Package last updated on 10 Sep 2021

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