Node JS
1
Introduction to [Link]
• [Link] is a development framework
based on Google’s V8 Java Script Engine
for chrome web browser
2
Introduction to [Link]
• Code is written in Java Script
• V8 compiles the code into machine code
to be executed
3
Introduction to [Link]
• [Link]
– Server side environment
– Run java script on server side
• [Link] is a great framework
– JavaScript end to end
• Both server side and client side scripts
– Event driven scalability
• Single Threaded and High scalable
- The two features that make [Link] stand-out are :
• Event-driven
• Non-blocking I/O model
4
Introduction to [Link]
– Extensibility
• Simple to install
• New modules to extend
– Fast Implementation
• Easy to setup Node JS and develop in it
5
Introduction to [Link]
• [Link] was developed in 2009 by Ryan
Dahl
• [Link] is environment
– Clean
– Easy to install,
– configure and
– deploy
6
Introduction to [Link]
• Who uses [Link]?
– Yahoo
– LinkedIn
– eBay
– New York Times
– Dow Jones
– Microsoft
7
Introduction to [Link]
• What is [Link] used for?
– Web services APIs
– Real-time multiplayer games
– Backend web services such as cross-domain,
server-side requests
– Web-based applications
– Multi client communication
8
Installing [Link]
• Download [Link] installer from
[Link]
• [Link] installer installs the necessary
files on your PC to get [Link] up and
running
• [Link] installation location
9
Installing [Link]
10
Installing [Link]
11
Installing [Link]
12
Installing [Link]
13
Installing [Link]
14
Installing [Link]
15
Installing [Link]
16
Installing [Link]
17
Installing [Link]
18
Installing [Link]
19
Installing [Link]
• Node – starts [Link] Java Script VM
• Npm – manages the [Link] packages
• Node_modules – consist of [Link]
packages
20
Installing [Link]
• Verify [Link] Executables
– To verify whether [Link] is installed and
working
• Execute the command “node” in command prompt
21
Installing [Link]
• Verify [Link] Executables
– To verify whether [Link] is installed and
working
22
Installing [Link]
• [Link] VM
23
Installing [Link]
• [Link](“ VIT Chennai”);
• To exit from console window
– Ctrl + C or Ctrl + d - Windows
– Cmd+C - Mac
24
Installing [Link]
• Selecting a [Link] IDE
– Eclipse
– WebStrom
– Text Editor
– Code will be in
• .js
• .json
• .html
• .css
25
Execution of Nodejs code in our lab
• Can type the code in a text editor
(notepad), save with .js extension
• Then in command prompt we can execute
using node command -> ex. node [Link] -> it
will make the server
• You connect to the server using
‘[Link] -> because the
server connect which you have written in
[Link] is listening in the port number 8080
26
Sample code
27
Reference
• [Link]
28