Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4255358
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:12:31+00:00 2026-05-21T05:12:31+00:00

Is there a (or several) coding style guide for node.js? If not, what are

  • 0

Is there a (or several) coding style guide for node.js? If not, what are the emerging styles used by the top open-source node projects?

I’m looking for a guide (or several guides) along the lines of PEP 8, the canonical Coding Style Guide for Python. I’ve seen various JavaScript guides not worth linking here (mostly old and targeted at client-side JavaScript). I found one interesting node.js style guide.

A coding style guide, or coding conventions, should include (but is not limited to):

  • Code layout: indentation (2 spaces, 4 spaces, tabs, …), newlines, line breaks, etc.
  • Whitespace, e.g., “function (arg)” vs. “function(arg)”
  • Semicolon or no semicolon, var declaration, …
  • Naming, e.g., do_this() vs. doThis(), var_name vs. varName, …
  • node.js and JavaScript idioms, e.g., == vs. ===, callback’s first arg is an error object, …
  • Comments and documentation
  • Accompanying tools, like lint checker, unit test framework, …

This topic obviously is highly subjective, but I think it’s an important step of a community to establish a common and widely accepted coding style in the process of getting mature. Also, it’s not all just about taste. In particular, rules like “use === instead of ==” have a direct influence on code quality.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T05:12:32+00:00Added an answer on May 21, 2026 at 5:12 am

    I’d review the coding standards checked by JSLint or look at the author of NPM (Isaac Shlueter’s) coding standards.

    You could also look at the style used by notable Node.JS coders:

    • TJ Holowaychuk
    • Isaac Shlueter
    • Tim Caswell
    • Jeremy Ashkenas
    • Felix Geisendörfer
    • Charlie Robbins
    • Marak Squires
    • Aaron Heckmann
    • Guillermo Rauch
    • Mikeal Rogers
    • Ryan Dahl + you could look at the actual Node.JS codebase

    I’ll throw mine in there for good measure 😉

    Edit: Suggestions from @alienhard

    • Google JavaScript style Guide
    • Felix’s Node.js Style Guide

    IMO there’s a few golden rules you should follow:

    • Never use with or eval
    • Use === over ==
    • Always declare your variables with var in the appropriate scope – don’t fallback to the global scope
    • Wrap your app in a closure (function(){})() if you plan on releasing code that runs server-side as well as in the browser
    • Callbacks should take err as the first argument and if they themselves take a callback as an argument, it should be last, e.g. callback(err, param1, param2, callback)

    Indentation, spacing between braces and keywords and semicolon placement are all a matter of preference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are several ways to do this, but I'm not sure which one of
There are several types of objects in a system, and each has it's own
There are several ways to iterate over a result set. What are the tradeoff
There are several plugin options for building a search engine into your Ruby on
There are several web applications which allow you to send photos from your mobile
There are several different methods for converting floating point numbers to Integers in JavaScript.
There are several people about (myself being one of them) who have been developing
There are several similar Oracle technologies - Oracle Streams, Oracle Change Data Capture and
There are several topics about what questions will be raised in an interview for
There are several filter methods for dates (year,month,day). If I want to match a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.