Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Node.js Best Practices

Node.js Best Practices

Presentation about Node.js Best Practices presented at Nodebp.

http://risingstack.com

Gergely Nemeth

January 21, 2015
Tweet

More Decks by Gergely Nemeth

Other Decks in Programming

Transcript

  1. $ whoami Work - RisingStack Twitter - @nthgergo GitHub -

    gergelyke Stuff I write - http://blog.risingstack.com
  2. Coding style - Callback convention - Always check for errors

    in callbacks - Return on callbacks - Try-catch in sync code only
  3. Handling Operational Errors • Try to solve the error -

    if a file is missing, you may need to create one first • Retry the operation, when dealing with network communication • Tell the client, that something is not ok - used, when handling user inputs • Crash the process, when the error condition is unlikely to change on its own, like the application cannot read its configuration file
  4. In case you want to learn Node.js with us... Node.js

    Essentials & Best Practices training Contact us at [email protected]