triple-beam
Shareable Symbol constants and standard logging-level configs for the winston ecosystem
Repository Health
Technical Analysis
triple-beam is a tiny utility package used internally by winston and logform to share a small set of well-known JavaScript Symbols — LEVEL, MESSAGE, and SPLAT — across otherwise independent packages without risking collisions with user-defined object properties. Because they’re Symbols rather than string keys, logging metadata can travel alongside a log entry (e.g. the raw, uncolorized level) without being visible to JSON.stringify or enumerable property iteration.
Alongside the symbols, it ships standard level/color definitions (npm, syslog, cli) so logging libraries that want npm-style or syslog-style severity levels don’t need to redefine them from scratch.
What You Get
LEVEL,MESSAGE, andSPLATexported Symbol constants for attaching hidden/non-enumerable metadata to log info objectsconfigs.npm— the standard npm-style levels (error, warn, info, http, verbose, debug, silly) with matching terminal colorsconfigs.syslog— RFC 5424-style syslog levels (emerg through debug) with matching colorsconfigs.cli— a CLI-oriented level/color set used by winston’s CLI format
Common Use Cases
- Building a winston-compatible log formatter that needs to read the raw level via the shared LEVEL symbol without mutating the user-visible level string
- Implementing a custom logform transform that needs access to the original interpolation arguments via the SPLAT symbol
- Bootstrapping a new logging library with battle-tested npm or syslog level/color defaults instead of hand-rolling them
- Interoperating with the winston ecosystem by attaching metadata in a way third-party formatters already know how to read
Under The Hood
Architecture - The entire package is a single index.js (about 40 lines) that uses Object.defineProperty to attach three well-known Symbols (LEVEL, MESSAGE, SPLAT, each created via Symbol.for(...) so they’re globally registered and shared across separately-installed copies of the package) plus a configs object onto exports. The configs object is populated from config/index.js, which re-exports four small files (npm.js, syslog.js, cli.js, and a shared allColors merge) each defining a flat levels map (level name → numeric severity) and a matching colors map (level name → terminal color name). Tech Stack - Plain CommonJS, zero runtime dependencies; devDependencies are limited to mocha/nyc/assume for testing and @dabh/eslint-config-populist for linting, plus a typescript devDependency used only to validate the shipped .d.ts types. Code Quality - test.js is a small mocha/assume suite asserting each symbol is defined and that the configs object structurally matches what winston expects; JSDoc comments annotate every export in index.js, and the config files are similarly documented with copyright/license headers per file. There are no complex code paths to test — the package is essentially static data plus symbol definitions. API Design - The public surface is intentionally tiny: three symbols and one nested config object, all consumed via simple destructuring (const { LEVEL, MESSAGE, SPLAT } = require('triple-beam')), which makes onboarding instant for anyone already using winston; the tradeoff is that the package is meaningless standalone — it only makes sense in the context of the winston/logform ecosystem it was extracted from.
Used by 4 apps in this directory
APITable
Low Code Platforms · Databases
API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.
Amplication
Developer Tools · AI Code Assistants · Automation
Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.
NocoBase
No Code Platforms · Low Code Platforms
Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.
Sourcebot
Search · Developer Tools · AI Code Assistants
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.