This document provides a summary of tools and best practices for developing Node.js applications. It recommends using process managers like PM2 or Forever to prevent apps from crashing. It also suggests tools for debugging like node-inspector. The document then discusses concepts like statelessness, Redis for state, popular frameworks like Express and Hapi, and testing. It emphasizes best practices like horizontal scalability, avoiding recreating existing tools, early testing, and using streams.
7. LET YOUR PROCESS
CRASH
$
npm
install
pm2@latest
-‐g
pm2
Modern CLI process manager for Node apps with a
builtin load-balancer
$
pm2
start
app.js
$
npm
install
forever
-‐g
forever
A simple CLI tool for ensuring that a given node
script runs continuously (i.e. forever)
$
forever
start
app.js
12. npm versioning
"dependencies":
{
"express":
"*"
}
No
Asterisks
Please for the love don’t use asterisks.
Use proper versioning.
"dependencies":
{
"express":
"4.0"
}
15. API
The natural born use case for Node.js
express
Fast, unopinionated, minimalist web framework
hapi
HTTP Server framework - from the minds at Walmart
restify
REST framework
16. FINAL THOUGHTS
horizontal
scalability
Be stateless or have a thought out solution
don’t
reinvent
the
wheel
unless you want to, npm is there for a reason
start
testing
early
Pick a testing framework and start writing tests
streams
Learn to use them - streams adventure
kiss
Keep it simple stupid
17. SLIDE OF MANY
THINGS
pm2
www.npmjs.org/package/pm2
forever
www.npmjs.org/package/forever
node-‐inspector
www.npmjs.org/package/node-‐inspector
npm
semver
www.npmjs.org/doc/misc/semver.html
redis
redis.io
expressjs
expressjs.com
hapi
hapijs.com
restify
mcavage.me/node-‐restify
jasmine
jasmine.github.io
stream-‐adventure
www.npmjs.org/package/stream-‐adventure
!