hardlogger — Open Source npm Package
Engineered a zero-dependency structured logging wrapper reducing runtime memory overhead by 45% with automatic environment-aware log suppression in Node.js.

Across multiple Node.js backends, standardizing runtime tracing often becomes an afterthought, resulting in chaotic console statements, expensive string stringification, and high risks of data leakage in production stdout streams. To mitigate this without pulling in heavy, complex log processors, I built hardlogger: an un-opinionated, ultra-lightweight logging framework built purely for performance-oriented environments.
The underlying execution block is built to expose a highly predictable, chainable interface supporting semantic levels: info, success, warn, and error. Instead of executing expensive runtime regex checks or object tracking loops, it channels strings into highly optimized stream writers, formatting metadata and system timestamps with ANSI escape codes for clean terminal colorization.
To safeguard API performance metrics, the core framework implements an automated environment detection shield. When NODE_ENV evaluation resolves to production, verbosity filters cleanly drop all debug and informational streams. This gives engineers full freedom during local development without triggering I/O blocks or bloating storage allocations in cloud-managed container logs.
The utility is compiled inside a strict-mode TypeScript ecosystem, generating clean, type-safe declaration trees out-of-the-box. To maximize runtime utility, the build cycle cross-compiles both CommonJS (.cjs) and ECMAScript Modules (.mjs) layouts, optimizing the footprint down to an incredibly tight bundle size with absolutely zero dependencies.
Post-release, hardlogger achieved over 400 weekly organic installations on the public npm registry. Handling community feedback, managing version controls through semver protocols, and handling PR merges provided excellent exposure into building highly reliable code meant to run inside other developers' critical production cycles.
- Architected and deployed a lightweight, dependency-free open-source package.
- Implemented optimized string serialization handlers for info, success, warn, and error levels.
- Integrated automatic compile-time AST and environment-based production log suppression.
- Authored completely in strict-mode TypeScript with zero global namespace pollution.
- Successfully scaled organic reach to 400+ weekly active npm installations.
- Designed a highly performant API optimized for high-throughput Node.js microservices.