Production Ready Node
Alice in Noderland
The Curious Case of Nodej(s)amin Button
$ whoami 
{ username: ‘@dscape’, 
past: ‘nodejitsu.com’, 
present: ‘yld.io’, 
much_excite: ‘open source’, 
dreams_in: JSON, 
node_modules: Number.MAX_VALUE 
}
$ whoami 
{ username: ‘@dscape’, 
past: ‘nodejitsu.com’, 
present: ‘yld.io’, 
much_excite: ‘open source’, 
dreams_in: JSON, 
node_modules: ~40 
}
$ watiznode4 
__________________________________ 
< node is more than just rest apis > 
---------------------------------- 
 ^__^ 
 (oo)_______ 
(__) )/ 
||----w | 
|| ||
How is node being used? 
Enterprise Startups and Hackers 
• (micro) Services 
• REST APIs 
• Message Queues 
• Fullstack Web Applications 
• Mobile 
• Enterprise Software 
• Internet of Things 
• Desktop Clients 
• Command Line Interfaces 
• Teaching 
• WebRTC 
• ROBOTS! 
• Bitcoin 
• Torrents 
• Databases
INTRODUCTION 
SUCH NODE. MUCH WOW
INTRODUCTION 
USE CASES 
Buy all that stuff you 
want directly from 
your phone. Node got 
you covered. 
Find where to go on your 
awesome vacation with 
proxies powered by the 
Nodes. 
Control your heating from 
your mobile using the 
awesome power of the 
Node.js force
INTRODUCTION 
TABLE OF CONTENTS 
• Frameworks 
• Structure 
• Setup 
• Testing & Coverage 
• Useful tools 
• Pre-production checklist 
• Running in production
FRAMEWORK 
WHAT TO CHOOSE
Structure
STRUCTURE 
MODULE
STRUCTURE 
COMMAND LINE TOOL
STRUCTURE 
WEB APP
STRUCTURE 
REST API
“Does it matter?”
Setup
SETUP 
CONFIGURATION FILES
SETUP 
CONFIGURATION FILES, TO AVOID
SETUP 
JSHINT
SETUP 
CODE STYLE
SETUP 
PRE COMMIT HOOKS
SETUP 
PRE COMMIT HOOKS (2)
SETUP 
BADGER BADGER BADGER MUSHROOM MUSHROOM
Testing
TESTING 
NODE ERROR HANDLING
TESTING 
COVERAGE CONTRACT
TESTING 
PERFORMANCE
TESTING 
PERFORMANCE (2)
TESTING 
PERFORMANCE
Pre-production checklist
$ shipit 
_____________________________ 
< nodejs production checklist > 
----------------------------- 
 ^__^ 
 (oo)_______ 
(__) )/ 
||----w | 
|| ||
PRE-PRODUCTION CHECKLIST 
OUTDATES MODULES
PRE-PRODUCTION CHECKLIST 
SECURITY SANITY CHECK
PRE-PRODUCTION CHECKLIST 
FREEZE YOUR DEPENDENCIES
Useful tools
USEFUL TOOLS 
JSONTOOL
USEFUL TOOLS 
ND
USEFUL TOOLS 
GHCOPY
USEFUL TOOLS 
NODE DEBUG
Running in Production
RUNNING IN 
PRODUCTION 
• pm2 vs forever vs mon 
• cluster vs mongroup 
• docker vs jenkins + chef vs PaaS 
• Managing the life cycle of applications
RUNNING IN 
PRODUCTION
RUNNING IN 
PRODUCTION 
• pm2 vs forever vs mon 
• cluster vs mongroup 
• docker vs jenkins + chef vs PaaS 
• Managing the life cycle of applications
@DSCAPE 
THANK YOU

NodeConf OneShot Budapest — Production Ready Node.js by Nuno Job