Node.js Basics

1,890 views 10 slides Nov 25, 2018
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

This slide explains basic about NodeJS.Node.js tutorials will help you learn the essentials of Node.js starting from the basics.


Slide Content

Objective
What is Node JS?
Why Node JS?
Setup NodeJS
Node Package Manager
Hello World Application

What is Node.js?
Created by Ryan Dahl in 2009 in Joyent
Server-side JavaScript Framework
Uses V8 is an open source JavaScript engine developed
by Google. Its written in C++ and is used in Google
Chrome Browser
Event-driven with Non-blocking I/O
Single threaded

Why Node.js?
1. Free from deadlocking Process
2. Event Driven Programming
3. Nonblocking I/O
4. Easy to build the scalable application
5. Same language(JS) for both backend and frontend
6. Large open source package System(NPM)
7. Hosting
8. A big corporate is taking care of project(Joyent)
9. Easy to build real-time application

Blocking Vs NonBlocking

Node JS Installation
Node JS installation can be done in four ways.
First of all, Go to the Node JS website which is
https://nodejs.org/en/download.
1. Precompiled Binary
2. Installer
3. Source Code
4. NVM (Node Version Manager)

Installation using NVM
NodeJS Installation command using the NVM:
NVM install <version_number>
This command will check the stable version based on the version
number and install the stable version.

Node JS basic commands
To check the version of install NodeJS
node -v
To change the NodeJS version

NVM use <version_number>
To run JavaScript code right from your terminal, you can use
the – e option
node -e 'console.log(3 + 2)'
Or
node -p '3 + 2'

NPM
NPM is a package manager for Node JS.NPM is the pre-build
libraries for Node JS.
Whenever you install Node JS, npm will automatically install in
your system.
NPM.inc is the company that host and maintains it.It is available
at https://npmjs.com.
To get the npm version, following command is used:
npm - v

Node.JS – as an interactive shell
> node
3 + 4
7
> true != false
true

Node.JS – as an interactive shell
> node
3 + 4
7
> true != false
true