goldbergyoni / nodebestpractices
git clone https://github.com/goldbergyoni/nodebestpractices.git
π₯ on GitHub Trending today
β The Node.js best practices list (July 2026)
+7
stars, 24h Β· #397
β
stars, 7 days
β
stars, 30 days
106k
β
total
11k
forks Β· 56 open issues
Star history starts 2026-10-20; the chart appears after the second daily snapshot.
LanguageDockerfile
LicenseCC-BY-SA-4.0
Created2017-09-15 (9y ago)
Last push4mo ago
Watchers1.9k
OwnerUser
Seen on GitHub Trending
- 2026-10-20 β #1 daily in dockerfile Β· +7 β
GitHub topics
nodejsjavascriptbest-practicesstyleguidestyle-guidenode-jsexpressexpressjsnodejs-developmentes6eslintmochamicroservicesrestnpmjesttypestesting
Links
- GitHub: github.com/goldbergyoni/nodebestpractices
- Homepage: https://twitter.com/nodepractices/
- Releases Β· Issues Β· Hacker News mentions
README excerpt
[β]: assets/images/checkbox-small-blue.png # Node.js Best Practices **Follow us on Twitter!** **@nodepractices** Read in a different language: **CN**, **FR**, **BR**, **RU**, **PL**, **JA**, **EU** ( **ES**, **HE**, **KR** and **TR** in progress! ) # π 2026 edition is here! - **π° Modernized to 2026**: Tons of text edits, new recommended libraries, and some new best practices - **β¨ Easily focus on new content**: Already visited before? Search for `#new` or `#updated` tags for new content only - **π Curious to see examples? We have a starter**: Visit Practica.js, our application example and boilerplate (beta) to see some practices in action # Welcome! 3 Things You Ought To Know First **1. You are reading dozens of the best Node.js articles -** this repository is a summary and curation of the top-ranked content on Node.js best practices, as well as content written here by collaborators **2. It is the largest compilation, and it is growing every week -** currently, more than 80 best practices, style guides, and architectural tips are presented. New issues and pull requests are created every day to keep this live book updated. We'd love to see you contributing here, whether that is fixing code mistakes, helping with translations, or suggesting brilliant new ideas. See our writing guidelines here **3. Best practices have additional info -** most bullets include a **πRead More** link that expands on the practice with code examples, quotes from selected blogs, and more information # By Yoni Goldberg ### Learn with me: As a consultant, I engage with worldwide teams on various activities like workshops and code reviews. πAND... Hold on, I've just launched my beyond-the-basics testing course, which is on a π limited-time sale until August 7th ## Table of Contents 1. Project Architecture Practices (6) ββ1.1 Structure your solution by components `#strategic` `#updated` ββ1.2 Layer your components, keep the web layer within its boundaries `#strategic` `#updated` ββ1.3 Wrap common utilities as packages, consider publishing ββ1.4 Use environment aware, secure and hierarchical config `#updated` ββ1.5 Consider all the consequences when choosing the main framework `#new` ββ1.6 Use TypeScript sparingly and thoughtfully `#new` 2. Error Handling Practices (12) ββ2.1 Use Async-Await or promises for async error handling ββ2.2 Extend the built-in Error object `#strategic` `#updated` ββ2.3 Distinguish operational vs programmer errors `#strategic` `#updated` ββ2.4 Handle errors centrally, not within a middleware `#strategic` ββ2.5 Document API errors using OpenAPI or GraphQL ββ2.6 Exit the process gracefully when a stranger comes to town `#strategic` ββ2.7 Use a mature logger to increase errors visibility `#updated` ββ2.8 Test error flows using your favorite test framework `#updated` ββ2.9 Discover errors and downtime using APM products ββ2.10 Catch unhandled promise rejections `#updated` ββ2.11 Fail fast, validate arguments using a dedicated library