SlideShare a Scribd company logo
Node.js Getting Started &
Best Practices
Charlotte Bots and AI Meetup –
January 2017
Introduction
Ramu Pulipati
botsplash.com
Conversational bots for News media & verticals
botsplash.com
Agenda
• Getting Started
– Basics
– Development Tools
– Features
– Challenges
• Best Practices
– Working with Node
– Common Mistakes
– Deployment & Monitoring
Basics
• What is it? Javascript Runtime
• Created by Ryan Dhal in 2009 and managed by
Node.js foundation
• Early adopters:
– Walmart, Netflix, Microsoft, LinkedIn, Paypal,
ebay, Facebook, NY Times, Uber, Many Startups
When to use
• Why use it?
– Easy to get started, learn and deploy
– Can build variety of applications
– Lots of open source packages and strong community
– Excellent performance (if done correctly)
– Javascript is everywhere. Talent pool.
• When NOT to use it?
– Compute =intensive tasks
– Need multiple threads/processes communication
– Strongly Typed Language* (Flow & TypeScript could
considered)
Applications
• Web applications (front end + server side)
• REST APIs
• Real-time applications/Web sockets (Socket.io)
• Mobile Apps (React Native)
• Desktop development (Electron)
• Chatbots (Slack, Facebook)
• Web crawlers (Cheerio)
• Internet of Things
• Command line tools
Development Tools
• Getting Started
– NVM for development
– Use platform binary or compile source for prod
• Editor Choices & Plugins
– Atom Editor with Nuclide plugin
– Visual Studio Code (for MS devs)
• Debugging
Using good tools/packages and practices will help build better code and less
frustration/errors with interpreted code
Node.js Features
• Node Event Loop
• Module system
• Event Emitter
• API for file system, sockets and processes
• Clustering
• ES5, ES6 and ES7 support: http://node.green/
NPM
• Node Package Manager (installed with node)
• Getting started commands
– npm init
– npm –save or npm –save-dev
– npm install
– gulp/grunt
– npm start
Challenges
• Interpreted code is a trap for large projects
• Multiple way to things (see screen)
• Everyday a new package is popular
BEST PRACTICES
Working with Node.js
• Project structure & npm link
• Lint your code & follow style guide
• Use Types – Flow vs TypeScript
• Nodemon, gulp, grunt and webpack
• Write tests for reusing code
• Debugging using node-inspector
Common Mistakes
• Using new operator
• Callbacks, Promises, Async/Await
• Code refactoring
• Large code base
• Handle errors – try/catch, promises
Alternatives to Callback
Must Have Packages
Package Purpose
momentjs Defacto datetime library
lodash Defacto collections library
request/fetch/axios Web client – REST and HTTP
bluebird/async Defacto Promise library
passport Web Authentication
sequelize Defacto ORM
dotenv Load environment variables
Winston Defacto Logging
eslint/babel Code linting
gulp/grunt Task/build manager
express/restify/sails/hel
met
Web applications
nodemailer Email
Deployment and Monitoring
• Prod deployment using Clustering or PM2
• Deployment: Nginx or Heroku or AWS Lambda
• Nginx is setup as reverse proxy
• Use papertrial or loggly or newrelic for log
monitoring
• Upgrading version (wait for 6 months)
Further Reading
• Javascript – The good parts
• NVM: https://github.com/creationix/nvm &
https://github.com/coreybutler/nvm-windows
• Style guide - https://github.com/airbnb/javascript
• Node.js support: http://node.green
• Web frameworks:
http://www.tothenew.com/blog/10-powerful-
node-js-frameworks-for-web-application-
development/

More Related Content

PPTX
Coding for the cloud - development of modern web applications
PPTX
Through Meteor to the stars - Developing full-stack SPA's with meteor.js
PDF
javerosmx-2015-marzo-groovy-java8-comparison
PPTX
Introduction to NodeJS
PDF
C4ainaction-Introduction to the Pyramid Web Framework
PPTX
Blazor - .NET in the Browser!
PDF
Use all the buzzwords
PDF
Python to go
Coding for the cloud - development of modern web applications
Through Meteor to the stars - Developing full-stack SPA's with meteor.js
javerosmx-2015-marzo-groovy-java8-comparison
Introduction to NodeJS
C4ainaction-Introduction to the Pyramid Web Framework
Blazor - .NET in the Browser!
Use all the buzzwords
Python to go

What's hot (20)

PDF
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
PDF
MEAN Stack - Google Developers Live 10/03/2013
PPTX
Don't worry with bower
PDF
SGCE 2015 REST APIs
PDF
Realtime MVC with Sails.js
PDF
Intro to Node.js
PDF
The JavaScript Delusion
PPTX
WordPress Development Environments
PDF
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
PDF
Florian Koch - Monitoring CoreOS with Zabbix
PDF
Using Zabbix API from Drupal
PPT
Next generation frontend tooling
PPTX
DevDay 2018 - Blazor
PPTX
Introduction to Node.js
PDF
NodeSummit - MEAN Stack
PPTX
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
PPTX
Untangling spring week12
PPTX
Node.JS and WebSockets with Faye
PDF
Troubleshooting Node.js
PDF
Blazor - The New Silverlight?
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
MEAN Stack - Google Developers Live 10/03/2013
Don't worry with bower
SGCE 2015 REST APIs
Realtime MVC with Sails.js
Intro to Node.js
The JavaScript Delusion
WordPress Development Environments
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Florian Koch - Monitoring CoreOS with Zabbix
Using Zabbix API from Drupal
Next generation frontend tooling
DevDay 2018 - Blazor
Introduction to Node.js
NodeSummit - MEAN Stack
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
Untangling spring week12
Node.JS and WebSockets with Faye
Troubleshooting Node.js
Blazor - The New Silverlight?
Ad

Viewers also liked (17)

PPTX
Raddoppiare il Fatturato
PPTX
Career advice for beginner software engineers
DOC
CHANTI RESUME 1
PPTX
ARTE ESENCIAL
DOCX
Plantilla icontec (1)
PPTX
resident evil filmes
PPTX
P7 e2 alfredopardo
PPT
El profesor ideal
DOC
Mehul Desai Resume_2016
DOCX
media pembelajaran berbasis web
PPTX
Workplace by facebook
DOCX
Caruso_Christopher_Resume
DOCX
Plantilla icontec
PPTX
AI Use Cases discussion
PDF
Estonia E-Residency: Country as a Service - BigchainDB & IPDB Meetup #3 - Fe...
PDF
COALA IP: a blockchain-ready Intellectual property licensing protocol - Bigch...
PDF
Blockchain Beyond Finance - Cronos Groep - Jan 17, 2017
Raddoppiare il Fatturato
Career advice for beginner software engineers
CHANTI RESUME 1
ARTE ESENCIAL
Plantilla icontec (1)
resident evil filmes
P7 e2 alfredopardo
El profesor ideal
Mehul Desai Resume_2016
media pembelajaran berbasis web
Workplace by facebook
Caruso_Christopher_Resume
Plantilla icontec
AI Use Cases discussion
Estonia E-Residency: Country as a Service - BigchainDB & IPDB Meetup #3 - Fe...
COALA IP: a blockchain-ready Intellectual property licensing protocol - Bigch...
Blockchain Beyond Finance - Cronos Groep - Jan 17, 2017
Ad

Similar to Node.js Getting Started &amd Best Practices (20)

PDF
Learning Nodejs For Net Developers Harry Cummings
PDF
Node.js Web Development: Powering the Future of Web Applications
PPTX
Definitive Guide to Powerful Nodejs Development.pptx
PDF
Introduction to Node.js
PPTX
Nodejs web service for starters
PPTX
Intro to Node.js (v1)
PPTX
Node js meetup
PDF
Unleshing the power of Node.Js: A comprehensive guide
PDF
Node.js Course 1 of 2 - Introduction and first steps
KEY
Dcjq node.js presentation
PPTX
Server Side Web Development Unit 1 of Nodejs.pptx
PDF
Nodejs vatsal shah
PDF
What is Node.js_ Where, When & How To Use It.pdf
PPTX
Node.JS Guide 2022.pptx
PDF
540slidesofnodejsbackendhopeitworkforu.pdf
PDF
Node.js Web Development SEO Expert Bangladesh LTD.pdf
PPTX
Mastering the Art of Node.js: Development Services for Success
PDF
Download full ebook of Learning Node Shelley Powers instant download pdf
PPTX
A brief intro to nodejs
PPTX
Introduction to node.js GDD
Learning Nodejs For Net Developers Harry Cummings
Node.js Web Development: Powering the Future of Web Applications
Definitive Guide to Powerful Nodejs Development.pptx
Introduction to Node.js
Nodejs web service for starters
Intro to Node.js (v1)
Node js meetup
Unleshing the power of Node.Js: A comprehensive guide
Node.js Course 1 of 2 - Introduction and first steps
Dcjq node.js presentation
Server Side Web Development Unit 1 of Nodejs.pptx
Nodejs vatsal shah
What is Node.js_ Where, When & How To Use It.pdf
Node.JS Guide 2022.pptx
540slidesofnodejsbackendhopeitworkforu.pdf
Node.js Web Development SEO Expert Bangladesh LTD.pdf
Mastering the Art of Node.js: Development Services for Success
Download full ebook of Learning Node Shelley Powers instant download pdf
A brief intro to nodejs
Introduction to node.js GDD

More from botsplash.com (13)

PDF
Migrating to postgresql
PPTX
Bootstrap SaaS startup using Open Source Tools
PPTX
Devops Days, 2019 - Charlotte
PPTX
Building NLP solutions for Davidson ML Group
PPTX
Getting started with postgresql
PPTX
Building NLP solutions using Python
PPTX
Chat interfaces, Extension to Digital Marketing
PPTX
Cloud computing options
PPTX
Data Science meets Digital Marketing
PPTX
botsplash deep dive
PPTX
Building Twitter bot using Python
PPTX
Python for data science
PPTX
Live development & tools
Migrating to postgresql
Bootstrap SaaS startup using Open Source Tools
Devops Days, 2019 - Charlotte
Building NLP solutions for Davidson ML Group
Getting started with postgresql
Building NLP solutions using Python
Chat interfaces, Extension to Digital Marketing
Cloud computing options
Data Science meets Digital Marketing
botsplash deep dive
Building Twitter bot using Python
Python for data science
Live development & tools

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PPTX
Cloud computing and distributed systems.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Machine learning based COVID-19 study performance prediction
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Spectroscopy.pptx food analysis technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Modernizing your data center with Dell and AMD
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Electronic commerce courselecture one. Pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Advanced methodologies resolving dimensionality complications for autism neur...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
Cloud computing and distributed systems.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Machine learning based COVID-19 study performance prediction
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Spectroscopy.pptx food analysis technology
Network Security Unit 5.pdf for BCA BBA.
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Modernizing your data center with Dell and AMD
GamePlan Trading System Review: Professional Trader's Honest Take
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Weekly Chronicles - August'25 Week I

Node.js Getting Started &amd Best Practices

  • 1. Node.js Getting Started & Best Practices Charlotte Bots and AI Meetup – January 2017
  • 2. Introduction Ramu Pulipati botsplash.com Conversational bots for News media & verticals botsplash.com
  • 3. Agenda • Getting Started – Basics – Development Tools – Features – Challenges • Best Practices – Working with Node – Common Mistakes – Deployment & Monitoring
  • 4. Basics • What is it? Javascript Runtime • Created by Ryan Dhal in 2009 and managed by Node.js foundation • Early adopters: – Walmart, Netflix, Microsoft, LinkedIn, Paypal, ebay, Facebook, NY Times, Uber, Many Startups
  • 5. When to use • Why use it? – Easy to get started, learn and deploy – Can build variety of applications – Lots of open source packages and strong community – Excellent performance (if done correctly) – Javascript is everywhere. Talent pool. • When NOT to use it? – Compute =intensive tasks – Need multiple threads/processes communication – Strongly Typed Language* (Flow & TypeScript could considered)
  • 6. Applications • Web applications (front end + server side) • REST APIs • Real-time applications/Web sockets (Socket.io) • Mobile Apps (React Native) • Desktop development (Electron) • Chatbots (Slack, Facebook) • Web crawlers (Cheerio) • Internet of Things • Command line tools
  • 7. Development Tools • Getting Started – NVM for development – Use platform binary or compile source for prod • Editor Choices & Plugins – Atom Editor with Nuclide plugin – Visual Studio Code (for MS devs) • Debugging Using good tools/packages and practices will help build better code and less frustration/errors with interpreted code
  • 8. Node.js Features • Node Event Loop • Module system • Event Emitter • API for file system, sockets and processes • Clustering • ES5, ES6 and ES7 support: http://node.green/
  • 9. NPM • Node Package Manager (installed with node) • Getting started commands – npm init – npm –save or npm –save-dev – npm install – gulp/grunt – npm start
  • 10. Challenges • Interpreted code is a trap for large projects • Multiple way to things (see screen) • Everyday a new package is popular
  • 12. Working with Node.js • Project structure & npm link • Lint your code & follow style guide • Use Types – Flow vs TypeScript • Nodemon, gulp, grunt and webpack • Write tests for reusing code • Debugging using node-inspector
  • 13. Common Mistakes • Using new operator • Callbacks, Promises, Async/Await • Code refactoring • Large code base • Handle errors – try/catch, promises
  • 15. Must Have Packages Package Purpose momentjs Defacto datetime library lodash Defacto collections library request/fetch/axios Web client – REST and HTTP bluebird/async Defacto Promise library passport Web Authentication sequelize Defacto ORM dotenv Load environment variables Winston Defacto Logging eslint/babel Code linting gulp/grunt Task/build manager express/restify/sails/hel met Web applications nodemailer Email
  • 16. Deployment and Monitoring • Prod deployment using Clustering or PM2 • Deployment: Nginx or Heroku or AWS Lambda • Nginx is setup as reverse proxy • Use papertrial or loggly or newrelic for log monitoring • Upgrading version (wait for 6 months)
  • 17. Further Reading • Javascript – The good parts • NVM: https://github.com/creationix/nvm & https://github.com/coreybutler/nvm-windows • Style guide - https://github.com/airbnb/javascript • Node.js support: http://node.green • Web frameworks: http://www.tothenew.com/blog/10-powerful- node-js-frameworks-for-web-application- development/