Winston

A battle-tested Node.js logging library with pluggable transports, custom formats, and multiple log levels.

Library
npm
v3.19.0
24,527 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
51 /100 Fair
Development Activity 16
Maintenance 20
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 →
81 /100 Excellent
Architecture 85
Code Quality 82
Innovation 78
Learning Curve 80

Winston is one of the most widely used logging libraries in the Node.js ecosystem, providing a single, consistent API for capturing application logs regardless of where they ultimately end up. Rather than hard-coding console output or file writes, developers configure one or more transports — Console, File, HTTP, or a wide range of community-maintained targets like Elasticsearch, Loggly, or CloudWatch — and let Winston route formatted log records to all of them simultaneously.

Built around Node’s stream primitives, Winston decouples log level filtering, structured metadata, and output formatting (via the companion logform package) from the underlying storage mechanism. This makes it straightforward to run different formats and levels per transport, attach default request-scoped metadata to child loggers, and centrally handle uncaught exceptions and unhandled promise rejections without scattering try/catch blocks throughout an application.

What You Get

  • A createLogger() factory producing loggers with npm-standard (or fully custom) severity levels and per-instance formatting.
  • Built-in Console, File, HTTP, and Stream transports, plus a stable transport interface for third-party targets.
  • Composable formats via the logform package — JSON, printf-style, colorization, timestamps, and error-stack handling.
  • Centralized exception and unhandled-rejection handlers, child loggers for per-request metadata, and a lightweight profiler for timing operations.

Common Use Cases

  • Structured JSON logging for services that ship logs to a centralized aggregator (ELK, Datadog, CloudWatch).
  • Multi-destination logging where errors go to a dedicated error.log/alerting transport and everything else goes to a combined log or console.
  • Request-scoped logging in web APIs using logger.child() to automatically attach a request ID to every log line.
  • Capturing uncaught exceptions and unhandled promise rejections as structured log entries instead of crashing silently.

Under The Hood

Architecture Winston’s core is lib/winston/logger.js, a Logger class extending Node’s Transform stream in object mode. Log calls funnel through .log() or level-shortcut methods generated dynamically in lib/winston/create-logger.js (e.g. .info(), .warn()), which build an info object and call .write(). The _transform() method pushes each info through the configured format pipeline (from the companion logform package) and streams the result to every piped transport via Node’s native .pipe(), so transports (lib/winston/transports/{console,file,http,stream}.js) are just writable streams the Logger writes into. Cross-cutting concerns — exception handling (exception-handler.js), rejection handling (rejection-handler.js), timing (profiler.js), and multi-logger management (container.js) — are implemented as separate collaborator classes composed onto the Logger instance in configure(), keeping the core class focused on the write/pipe pathway.

Tech Stack Winston 3.19.0 is pure CommonJS JavaScript (99% JS, under 1% TypeScript typings in index.d.ts) targeting Node >=12. It depends on a small, purpose-built set of sibling packages from the same winstonjs org — logform (formatting), winston-transport (transport base class), triple-beam (shared Symbols), @dabh/diagnostics (debug logging) — plus readable-stream for consistent stream behavior across Node versions, async for transport iteration, safe-stable-stringify for safe JSON serialization, and @colors/colors for terminal coloring. The build toolchain uses Babel to produce a dist/ browser bundle from the same lib/ source, and Jest (with separate unit/integration configs) drives the test suite.

Code Quality The test suite is substantial and organized (test/unit/winston/**, test/integration/**), covering the logger core, each transport, exception/rejection handlers, the profiler, and the container across 36 test files, using Jest with assume for BDD-style assertions and std-mocks for capturing stdout/stderr. Code style is enforced via a shared ESLint config (@dabh/eslint-config-populist) and Prettier. Naming and structure are consistent (one file per concern under lib/winston/), though some methods (e.g. Logger.log()) branch heavily on arguments.length to preserve backward compatibility with winston@1/2 call signatures, trading some readability for API stability — a tradeoff the maintainers document explicitly in comments and the UPGRADE-3.0.md guide.

API Design The primary API surface — winston.createLogger({ level, format, transports }) plus dynamically generated level methods (.info(), .error(), etc.) — requires very little boilerplate to get started, and the README leads with a working quick-start example. Ergonomics are strong for common cases (logger.child() for scoped metadata, logger.profile() for timing) but the format system, while powerful, has a learning curve: composing format.combine(timestamp(), label(), myFormat) correctly requires understanding the mutable info object and Symbol-keyed properties (LEVEL, MESSAGE, SPLAT) from triple-beam, which isn’t obvious from casual API browsing. Extensive documentation (a 36KB README, a dedicated docs/transports.md, and 25+ runnable examples in examples/) substantially offsets this.

Used by 50 apps in this directory

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 2 weeks ago
TypeScript
67%
AGPL 3.0

Plane

Collaboration · Productivity · Project Management

61,353

Open-source project management platform to replace Jira, Linear, and ClickUp — with built-in cycles, real-time collaborative docs, and full self-hosting.

View details
92
Repo Health
82
Technical
77
Dependency
Built with
TypeScript 67%
Python 30%
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 1 weeks ago
TypeScript
98%
MIT

Promptfoo

AI Development

26,358

An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.

View details
90
Repo Health
73
Technical
67
Dependency
Built with
TypeScript 98%
Updated 6 days ago
JavaScript
50%
AGPL 3.0

QRev

AI Agents · CRM

364

Open source AI-first sales platform that replaces Salesforce with autonomous agents handling prospecting, outreach, and lead management at scale.

View details
39
Repo Health
68
Technical
64
Dependency
Built with
JavaScript 50%
Python 28%
TypeScript 14%
Updated 8 months ago
TypeScript
100%
AGPL 3.0

RSSHub

Automation · Social Media

46,631

Turn any website into an RSS feed — social media, streaming platforms, and niche sites all become subscribable in seconds.

View details
94
Repo Health
82
Technical
71
Dependency
Built with
TypeScript 100%
Updated 6 days ago
Python
100%
Other

Sourcebot

AI Code Assistants · Developer Tools · Search

4,005

A self-hosted, AI-powered code search engine that indexes every repo across GitHub, GitLab, Bitbucket, Gitea, Gerrit, and Azure DevOps, so both engineers and coding agents can search, browse, and ask questions about your codebase from one place.

View details
86
Repo Health
83
Technical
61
Dependency
Built with
Python 100%
Updated 1 weeks ago
TypeScript
89%
Other

strapi

CMS

73,368

Open-source headless CMS that auto-generates REST and GraphQL APIs from your content models, with a fully customizable admin panel you control.

View details
93
Repo Health
84
Technical
63
Dependency
Built with
TypeScript 89%
JavaScript 11%
Updated 1 weeks ago
Go
75%
AGPL 3.0

Teleport

Authentication · Security

21,016

Zero-trust infrastructure access platform that replaces credentials and VPNs with short-lived certificates, SSO, and identity-aware proxies for SSH, Kubernetes, databases, RDP, and AI agents.

View details
94
Repo Health
81
Technical
68
Dependency
Built with
Go 75%
TypeScript 16%
Updated 1 weeks 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