goldbergyoni /nodebestpractices
✅ The Node.js best practices list (July 2026)
★ 105,746⑂ 10,738👁 1,916⑃ 1,018● 345▤ 0
More from this author
+6
Daily
+30
Weekly
105,746
stars
10,738
forks
1,916
watchers
1,018
prs
345
issues
0
releases
README
[✔]: assets/images/checkbox-small-blue.png
Node.js Best Practices
Follow us on Twitter! @nodepractices
Read in a different language: , , , , , ,  (
🎊 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 errTop issues
#1117New bullet: Choose your framework - Express vs Nest vs Fastify13 comments · 2021-11-30#893Add matching ESLint rules12 comments · 2021-02-22#784Multiple problems in 7.2 (Prefer native JS methods over user-land utils like Lodash)9 comments · 2020-10-27#1093Create a policy of permanently deleting empty issues8 comments · 2021-11-08#1194Translate to Ukrainian 🇺🇦 7 comments · 2022-07-28#1122Change bootstrap with node in Docker to run with dumb-init / tini7 comments · 2021-12-02#1014Prefer cross-platform API when possible6 comments · 2021-06-18#996Add Nick as collaborator6 comments · 2021-05-30
相关报道 (3)
News & coverage (6)
Hacker NewsNode.js Best Practices 2024▲ 3 · 0 comments · 2024-12-17Hacker NewsThe Node.js best practices list (December 2023)▲ 2 · 0 comments · 2023-12-29Hacker NewsNode.js Best Practices▲ 2 · 0 comments · 2023-08-08Hacker NewsThe Node.js best practices list (October 2020)▲ 2 · 0 comments · 2020-10-18Hacker NewsThe Node.js best practices list (August 2022)▲ 1 · 0 comments · 2022-08-26Hacker NewsNode.js best practices (Oct 2020)▲ 1 · 0 comments · 2020-10-13