$ show goldbergyoni/nodebestpractices
This repository is a comprehensive, community-maintained knowledge base of Node.js best practices — not a runnable application or data pipeline. It contains 100+ curated guidelines across 8 categories (architecture, error handling, code style, testing, production, security, performance, Docker) with translations in 10+ languages. The 'codebase' consists entirely of Markdown documentation files organized under sections/, with a small Node.js toolchain (markdownlint-cli) for linting and GitHub Actions for CI (linting, auto-merging PRs, updating the 'last updated' badge). There are no runtime entry points, APIs, or data flows. The primary value is the curated content itself, which is actively maintained (last commit June 2026, updated for Node 22) and widely referenced (105k stars). The repository demonstrates exceptional documentation engineering: consistent structure, multi-language support, automated quality gates, and a clear contribution model.
The LLM identified 6 files worth highlighting for reuse:
GitHub Actions workflow that runs markdownlint on all README files on every push/PR. Demonstrates a clean CI setup for documentation quality: uses a dedicated working directory (.operations), installs dependencies, and runs linting. Reusable as a template for any Markdown-heavy project wanting automated style enforcement.
Workflow that automatically updates the 'Last update' badge in README.md to today's date on every push to master. Uses a shell script to compute the date, generate a new shields.io badge URL, and create a PR with the change. Reusable pattern for any repo wanting self-updating metadata badges without manual intervention.
Reference multi-stage Dockerfile demonstrating 10+ Node.js Docker best practices in a single file: multi-stage build, non-root user, explicit base image tags, npm ci for reproducible installs, dev dependency cleanup, cache optimization, graceful shutdown via direct node entrypoint, and health-check-ready structure. Serves as a production-ready template engineers can copy directly.
Core architectural guideline advocating 3-tier layering (entry-points, domain, data-access) within each component. Includes clear code examples showing correct vs incorrect structure, explains why passing web framework objects (req/res) into domain logic creates coupling, and provides a folder structure template. Reusable as an architectural decision record (ADR) or onboarding document for Node.js teams.
Defines a centralized error handling pattern where all entry points (API, cron, queues) delegate to a single error handler object that classifies errors (operational vs programmer), logs with context, decides process fate, and integrates with monitoring. Includes code for a reusable error handler class with isTrustedError() and handleError() methods. Extractable as a standalone npm package.
Advocates per-test data seeding over global fixtures to prevent test coupling and flakiness. Shows anti-pattern (shared seed data mutated across tests) vs correct pattern (each test creates its own DB records). Includes practical Mocha/Chai examples. Reusable as a team testing standard or CI gate documentation.