morgan

Battle-tested HTTP request logger middleware for Node.js and Express.

Library
npm
v1.12.1
8,200 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
76 /100 Good
Development Activity 80
Maintenance 56
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
74 /100 Good
Architecture 70
Code Quality 78
Innovation 55
Learning Curve 92

Morgan is an HTTP request logger middleware for Node.js, maintained under the expressjs GitHub organization and used with both Express and plain Node HTTP servers. It logs incoming requests using predefined formats (combined, common, dev, short, tiny) or fully custom format strings built from named tokens.

Morgan supports custom tokens, conditional/skip logic for filtering which requests get logged, and configurable output streams, making it a lightweight, dependency-light choice for request-level observability in Node.js applications.

What You Get

  • Predefined log formats (combined, common, dev, short, tiny) matching common web server log conventions
  • Custom format strings built from named tokens (:method, :url, :status, :response-time, etc.)
  • Support for registering custom tokens to log application-specific request/response data
  • Configurable skip functions to conditionally omit logging specific requests
  • Pluggable output streams for directing logs to files, external services, or stdout

Common Use Cases

  • Logging every incoming HTTP request/response in an Express application for debugging
  • Producing Apache-style combined/common access logs for production Node.js servers
  • Filtering logs to only capture errors or slow requests via custom skip functions
  • Piping request logs into a file or external log aggregator via a custom stream

Under The Hood

Architecture - Morgan is implemented as a single middleware factory function (index.js) that wraps on-finished to hook into the response lifecycle, on-headers to capture response timing before headers are sent, and a token registry (morgan.token()) that resolves format placeholders like :method or :status at log time. Tech Stack - Pure JavaScript with minimal runtime dependencies: basic-auth for the :remote-user token, debug for internal debug logging, depd for deprecation warnings, and on-finished/on-headers for response lifecycle hooks; no build step or TypeScript, published as CommonJS. Code Quality - The project has a single but extensive test suite (test/morgan.js, ~1,800 lines) covering all predefined formats, custom tokens, skip functions, and streaming behavior; linting is enforced via ESLint with the standard config, and coverage is tracked via Coveralls. API Design - The API is a single default export (morgan(format, options)) used directly as Express/Connect middleware, with an extremely low barrier to entry — a one-line app.use(morgan('combined')) covers the common case, while morgan.token() provides an escape hatch for custom fields.

Used by 18 apps in this directory

TypeScript
44%
Other

Magic

AI Agents · Automation · Low Code Platforms

5,055

Magic is an enterprise-grade open-source AI agent platform combining a generalist AI agent, workflow engine, IM, and collaborative office system for running an AI-powered digital workforce.

View details
68
Repo Health
79
Technical
65
Dependency
Built with
TypeScript 44%
PHP 32%
Updated 2 months ago
TypeScript
87%
MIT

medusa

Ecommerce

36,897

The most flexible open-source commerce platform — build B2C, B2B, and marketplace applications with modular, composable commerce primitives.

View details
94
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 87%
JavaScript 12%
Updated 6 days ago
JavaScript
88%
GPL 3.0

NodeBB

Community

15,242

Modern Node.js forum software with real-time WebSockets, multi-database support, and a plugin ecosystem — the community platform built for the open web and the Fediverse.

View details
97
Repo Health
78
Technical
70
Dependency
Built with
JavaScript 88%
Go Template 11%
Updated 5 days ago
TypeScript
91%
AGPL 3.0

PeerTube

Social Media

15,362

A federated, ActivityPub-based video hosting platform built by Framasoft — self-hostable instances interconnect into a network with no vendor lock-in, P2P-assisted streaming, and no ads.

View details
96
Repo Health
75
Technical
66
Dependency
Built with
TypeScript 91%
Updated 1 weeks ago
TypeScript
90%
MIT

Plasmic

CMS · Design Tools · Low Code Platforms

7,125

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
64
Dependency
Built with
TypeScript 90%
Updated 6 days ago
Go
90%
AGPL 3.0

Pyroscope

Developer Tools · Devops · Monitoring

11,703

An open-source, horizontally scalable continuous profiling platform that pinpoints CPU, memory, and I/O bottlenecks down to the exact line of code, built by Grafana Labs alongside Loki, Tempo, and Mimir.

View details
92
Repo Health
89
Technical
65
Dependency
Built with
Go 90%
Updated 5 days ago
TypeScript
98%
Apache 2.0

Tianji

Analytics · Monitoring

3,119

Replace Google Analytics, UptimeKuma, and Prometheus with one self-hosted platform that tracks websites, monitors uptime, and reports server health.

View details
86
Repo Health
76
Technical
64
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
99%
Apache 2.0

Trigger.dev

AI Development · Automation · Developer Tools

16,606

Build and deploy fully-managed AI agents and background jobs in TypeScript — with no timeouts, durable retries, real-time observability, and elastic scaling built in.

View details
90
Repo Health
9
Technical
63
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
72%
AGPL 3.0

Worklenz

Collaboration · Product Management · Project Management

3,259

All-in-one open source project management for teams who want full control — plan projects, track tasks, manage resources, and monitor finances without the SaaS lock-in.

View details
87
Repo Health
7
Technical
64
Dependency
Built with
TypeScript 72%
JavaScript 21%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers