Introduction to Node.js
Vinothini B

© Spritle Software Private Limited | http://www.spritle.com
Agenda
• Introduction
• Getting started
– Basic Install, Web App (Express, Jade)

• Samples
– Sample app in Express
– Sample app in Geddy

© Spritle Software Private Limited | http://www.spritle.com
Introduction - I
• Node.js is a platform built on Chrome's
JavaScript runtime for easily building fast,
scalable network applications.
• Node.js uses an event-driven, non-blocking
I/O model that makes it lightweight and
efficient, perfect for data-intensive real-time
applications that run across distributed
devices.
© Spritle Software Private Limited | http://www.spritle.com
Introduction - II
• JavaScript everywhere
• Files I/O and DB queries are non-blocking
• Great performance even while handling a big
number of users
• Set of tools and libraries living on top on V8

© Spritle Software Private Limited | http://www.spritle.com
Bring it to Your Machine
• Install nvm (node version manager)
– like rvm in ruby world
– nvm install 0.10.8
• rvm install ruby 2.0.0

• Use npm to install node packages
– like gem in ruby world
– npm install –g express
• gem install faker
© Spritle Software Private Limited | http://www.spritle.com
WebApp in a Minute
npm install -g express
express --sessions vb_songs
create : vb_songs
create : vb_songs/package.json
create : vb_songs/app.js
create : vb_songs/routes
create : vb_songs/routes/index.js
create : vb_songs/routes/user.js
create : vb_songs/views
create : vb_songs/views/layout.jade
create : vb_songs/views/index.jade
create : vb_songs/public/images
create : vb_songs/public/javascripts
create : vb_songs/public
create : vb_songs/public/stylesheets
create : vb_songs/public/stylesheets/style.css

npm install
node app.js
Spritle Software Private Limited | http://www.spritle.com
Code Walk-through with Samples

• vb_songs app – Sample app
–package.json

• Like Rails Scaffolding – Sample CRUD
–geddy | compound

© Spritle Software Private Limited | http://www.spritle.com
Thank you
&
Questions
http://www.Spritle.com
Copyright: Spritle Software Private Limited

Introduction to Node.js by Vinothini B

  • 1.
    Introduction to Node.js VinothiniB © Spritle Software Private Limited | http://www.spritle.com
  • 2.
    Agenda • Introduction • Gettingstarted – Basic Install, Web App (Express, Jade) • Samples – Sample app in Express – Sample app in Geddy © Spritle Software Private Limited | http://www.spritle.com
  • 3.
    Introduction - I •Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. • Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. © Spritle Software Private Limited | http://www.spritle.com
  • 4.
    Introduction - II •JavaScript everywhere • Files I/O and DB queries are non-blocking • Great performance even while handling a big number of users • Set of tools and libraries living on top on V8 © Spritle Software Private Limited | http://www.spritle.com
  • 5.
    Bring it toYour Machine • Install nvm (node version manager) – like rvm in ruby world – nvm install 0.10.8 • rvm install ruby 2.0.0 • Use npm to install node packages – like gem in ruby world – npm install –g express • gem install faker © Spritle Software Private Limited | http://www.spritle.com
  • 6.
    WebApp in aMinute npm install -g express express --sessions vb_songs create : vb_songs create : vb_songs/package.json create : vb_songs/app.js create : vb_songs/routes create : vb_songs/routes/index.js create : vb_songs/routes/user.js create : vb_songs/views create : vb_songs/views/layout.jade create : vb_songs/views/index.jade create : vb_songs/public/images create : vb_songs/public/javascripts create : vb_songs/public create : vb_songs/public/stylesheets create : vb_songs/public/stylesheets/style.css npm install node app.js Spritle Software Private Limited | http://www.spritle.com
  • 7.
    Code Walk-through withSamples • vb_songs app – Sample app –package.json • Like Rails Scaffolding – Sample CRUD –geddy | compound © Spritle Software Private Limited | http://www.spritle.com
  • 8.

Editor's Notes

  • #4 Reference: http://www.slideshare.net/martincabrera/node-js-presentation
  • #5 Reference: http://www.slideshare.net/martincabrera/node-js-presentation
  • #6 Talk about https://npmjs.org/ like how it is at ruby-gems.org