In my opinion this set of styles will be useful to build beautiful and consistent software and it will be easy for the fellow developer to understand.
- Use asynchronous functions over synchronous.
- Use Semicolons.
- Use single quotes instead of double quotes.
- Declare one variable per var statement.
- Constants should be uppercase.
- Variables should be camel cased and it should be in lower case.
- Use of '===' (triple equality operator) instead of '==' (double equality operator.)
- Always use return statements in a function.
- Named closure instead of Unnamed closure.
These all are the styles which I liked to share and its upto you to follow or not :). But the important one is to use Asynchronous functions over synchronous functions as it makes your Nodejs application way too faster.
If you have any other styles which you like to share, please do comment.
Please Like and Share the Blog, if you find it interesting and helpful.