Winston

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

Library
npm
v3.19.0
24,504stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
71/100Good
Development Activity64
Maintenance52
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture85
Code Quality82
Innovation78
Learning Curve80

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
94%
MIT

Actual

Invoicing Finance

28,224

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
77
Dependency
Built with
TypeScript94%
Updated yesterday
TypeScript
88%
Other

AFFiNE

Productivity · Project Management · Note Taking

71,668

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
68
Dependency
Built with
TypeScript88%
Updated today
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
JavaScript
95%
MIT

AnythingLLM

Developer Tools · Automation · AI Assistants

64,914

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
91
Repo Health
78
Technical
68
Dependency
Built with
JavaScript95%
Updated today
JavaScript
100%
Other

Automatisch

Automation · No Code Platforms

13,936

Self-hosted, no-code workflow automation that keeps your data on your own servers—a privacy-first alternative to Zapier with 90+ integrations.

View details
49
Repo Health
78
Technical
64
Dependency
Built with
JavaScript100%
Updated 6 months ago
TypeScript
96%
Other

Cal.diy

Scheduling

47,796

The 100% MIT-licensed, community-driven scheduling platform — self-host your own booking infrastructure with no enterprise strings attached.

View details
93
Repo Health
86
Technical
66
Dependency
Built with
TypeScript96%
Updated 1 weeks ago
TypeScript
97%
AGPL 3.0

Checkmate

Devops · Analytics · Monitoring

10,556

Self-hosted uptime and infrastructure monitoring with multi-protocol checks, global geo-coverage, and beautiful real-time dashboards.

View details
91
Repo Health
82
Technical
69
Dependency
Built with
TypeScript97%
Updated yesterday
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today

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

Search