SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Node.JS Introduction
Ahmed Elbassel
Email: elbassel.n13@gmail.com
Skype: ahmed_elbassel
Agenda
Story of Node Js
V8 JavaScript Engine
Platform Vs Framework
What is node?
What Is Node not?
Blocking code
Asynchronous: the browser
Asynchronous: the server
Event Loop
Modularity
Installing
Story of Node Js
Inventor: Ryan Dahl
Ryan Dahl is a math student but he decided to go with programming.
Story of Node Js
Once upon a time he was uploading image using flickr, and there is was no
status bar.
And that was the push to Node JS creation.
V8 JavaScript Engine
V8 is Google's open source JavaScript engine.
V8 is written in C++ and is used in Google Chrome, the open source browser from Google.
V8 can run standalone, or can be embedded into any C++ application.
Platform VS Framework
What is Software platform?
- A software platform is, in the most general sense, whatever pre-existing environment a
piece of computer software or code object is designed to run within, obeying its
constraints, and making use of its facilities.
What is a Software framework?
- For me, it’s a tool that helps you develop application in a specific way, providing specific
functions you don’t have to do everytime.
- Here is an awesome example.
What is Node.js?
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.
What is Node.js?
Built on JS:
The dream of Java write once run everywhere, everyone has it now :)
JS is unavoidable, you will write JS code.
When AJAX has released. JS started to evolve rapidly.
Moreover, because Mozilla, Microsoft, google, opera, started to develop
it.
What is Node.js?
Node.js uses the Google V8 JavaScript engine to execute code, and a large
percentage of the basic modules are written in JavaScript. Node.js
contains a built-in library to allow applications to act as a Web server
without software such as Apache HTTP Server or IIS.
What is Node.js?
Node.js is gaining adoption as a server-side platform and is used by
Microsoft, Yahoo!, Walmart, Groupon,SAP, LinkedIn, Rakuten,
PayPal,Voxer,and GoDaddy.
What is Node.js?
Dahl was guided by a few rigid principles:
A Node program/process runs on a single thread, ordering execution through an event
loop.
Web applications are I/O intensive, so the focus should be on making I/O fast
Program flow is always directed through asynchronous callbacks
Complex programs should be assembled from simpler programs
What Is Node not?
● It is not a web framework.
● For Beginners.
○ It requires more knowledge to work with it.
● Multi-threaded.
Blocking code
The most common task that any developer would do is File I/O, this being a very fundamental process
:
- Open a File.
- Read it's contents and print.
- Do something else.
- For two files, suppose each file
needs 5 seconds to be read.
Blocking code
Notes on the previous code:
It's a blocking code, until the read operation is completed, the next lines of
code is not executed.
It takes 10 seconds to read both files.
5 seconds 5 seconds
Asynchronous: the browser
Node uses event-driven and non blocking I/O model.
At the browser:
$.get('/getData’, function(response){
console.log('my responset' + response);
});
Asynchronous: the server
It brings the asynchronous model to the server too.
Non-blocking code:
A waiting process is a wasteful process, especially when waiting for I/O.
Asynchronous: the server
It’s non-blocking code, it’s it takes only 5 seconds to read both files:
5 seconds
5 seconds
Event Loop
What is the Event Loop?
The event loop is what allows Node.js to perform non-blocking I/O operations.
despite the fact that JavaScript is single-threaded — by offloading operations to
the system kernel whenever possible.
Since most modern kernels are multi-threaded, they can handle multiple
operations executing in the background. When one of these operations
completes, the kernel tells Node.js so that the appropriate callback may be
added to the poll queue to eventually be executed.
Modularity
In the book The Art of Unix Programming, Eric Raymond proposed the Rule
of Modularity:
Developers should build a program out of simple parts connected by well defined interfaces, so
problems are local, and parts of the program can be replaced in future versions to support new
features. This rule aims to save time on debugging complex code that is complex, long, and
unreadable.
Installing
- Windows
- Ubuntu
- Mac
Installing
Windows:
- go to Node website: https://nodejs.org/
- download the node version based on your Windows system(32 - 64)
Installing
Ubuntu:
sudo apt-get update
sudo apt-get install nodejs
Then, Node.js is installed, open a new terminal and write comman
node and press enter.
You can write JS code there.
Installing
Mac:
- Go to: https://nodejs.org/en/download/
- Click Macintosh installer to download
- Double click to install
- Then, Node.js is installed, open a new terminal and write command
node and press enter.
- You can write JS code there.

Weitere ähnliche Inhalte

Was ist angesagt?

Protractor
Protractor Protractor
Protractor
Artem Chechoro
 
Presentation_Protractor
Presentation_ProtractorPresentation_Protractor
Presentation_Protractor
Umesh Randhe
 

Was ist angesagt? (20)

Introduction to Integration Testing With Cypress
Introduction to Integration Testing With CypressIntroduction to Integration Testing With Cypress
Introduction to Integration Testing With Cypress
 
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil TayarCypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
 
ASP.NET Core
ASP.NET CoreASP.NET Core
ASP.NET Core
 
Building Native Android Apps with JavaScript
Building Native Android Apps with JavaScriptBuilding Native Android Apps with JavaScript
Building Native Android Apps with JavaScript
 
Cypress first impressions
Cypress first impressionsCypress first impressions
Cypress first impressions
 
Protractor
Protractor Protractor
Protractor
 
A walkthrough of JavaScript ES6 features
A walkthrough of JavaScript ES6 featuresA walkthrough of JavaScript ES6 features
A walkthrough of JavaScript ES6 features
 
CD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfCD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdf
 
Enjector Kernel - Workflow Module Demo
Enjector Kernel  - Workflow Module DemoEnjector Kernel  - Workflow Module Demo
Enjector Kernel - Workflow Module Demo
 
Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
PHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the codePHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the code
 
Nodejs
NodejsNodejs
Nodejs
 
Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?Why you should switch to Cypress for modern web testing?
Why you should switch to Cypress for modern web testing?
 
Cypress Automation
Cypress  AutomationCypress  Automation
Cypress Automation
 
Google App Engine - Java Style
Google App Engine - Java StyleGoogle App Engine - Java Style
Google App Engine - Java Style
 
ElasticMQ : Server for Local SQS
ElasticMQ : Server for Local SQSElasticMQ : Server for Local SQS
ElasticMQ : Server for Local SQS
 
Branching Strategies: Feature Branches vs Branch by Abstraction
Branching Strategies: Feature Branches vs Branch by AbstractionBranching Strategies: Feature Branches vs Branch by Abstraction
Branching Strategies: Feature Branches vs Branch by Abstraction
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshop
 
Presentation_Protractor
Presentation_ProtractorPresentation_Protractor
Presentation_Protractor
 

Andere mochten auch

ESL Update for Principals 12/11/12
ESL Update for Principals 12/11/12ESL Update for Principals 12/11/12
ESL Update for Principals 12/11/12
Eric Lech
 
youthpass_Jakub2015
youthpass_Jakub2015youthpass_Jakub2015
youthpass_Jakub2015
Jakub Pajan
 
Single-Page Web Application Architecture
Single-Page Web Application ArchitectureSingle-Page Web Application Architecture
Single-Page Web Application Architecture
Eray Arslan
 

Andere mochten auch (20)

Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Best node js course
Best node js courseBest node js course
Best node js course
 
Ba Node.js Meetup React Native Presentation
Ba Node.js Meetup React Native PresentationBa Node.js Meetup React Native Presentation
Ba Node.js Meetup React Native Presentation
 
Run-time of Node.js : V8 JavaScript Engine
Run-time of Node.js: V8 JavaScript EngineRun-time of Node.js: V8 JavaScript Engine
Run-time of Node.js : V8 JavaScript Engine
 
Scality S3 Server: Node js Meetup Presentation
Scality S3 Server: Node js Meetup PresentationScality S3 Server: Node js Meetup Presentation
Scality S3 Server: Node js Meetup Presentation
 
Deber 1
Deber 1Deber 1
Deber 1
 
Business consultants what they do and how important are they
Business consultants  what they do and how important are theyBusiness consultants  what they do and how important are they
Business consultants what they do and how important are they
 
ESL Update for Principals 12/11/12
ESL Update for Principals 12/11/12ESL Update for Principals 12/11/12
ESL Update for Principals 12/11/12
 
youthpass_Jakub2015
youthpass_Jakub2015youthpass_Jakub2015
youthpass_Jakub2015
 
Guerrilla rural del ERP
Guerrilla rural del ERPGuerrilla rural del ERP
Guerrilla rural del ERP
 
MLM Portfolio
MLM PortfolioMLM Portfolio
MLM Portfolio
 
Animación3°2 aracelif
Animación3°2 aracelifAnimación3°2 aracelif
Animación3°2 aracelif
 
single page application
single page applicationsingle page application
single page application
 
Angular 2 with TypeScript
Angular 2 with TypeScriptAngular 2 with TypeScript
Angular 2 with TypeScript
 
intervención escaleras
intervención escalerasintervención escaleras
intervención escaleras
 
The Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cliThe Tale of 2 CLIs - Ember-cli and Angular-cli
The Tale of 2 CLIs - Ember-cli and Angular-cli
 
Rits Brown Bag - TypeScript
Rits Brown Bag - TypeScriptRits Brown Bag - TypeScript
Rits Brown Bag - TypeScript
 
Single-Page Web Application Architecture
Single-Page Web Application ArchitectureSingle-Page Web Application Architecture
Single-Page Web Application Architecture
 
Angular 2 + TypeScript = true. Let's Play!
Angular 2 + TypeScript = true. Let's Play!Angular 2 + TypeScript = true. Let's Play!
Angular 2 + TypeScript = true. Let's Play!
 
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 MinutesUsing Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
 

Ähnlich wie 02 Node introduction

Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous  Blocking or synchronous.pdfNode Js Non-blocking or asynchronous  Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
DarshanaMallick
 
Node.js.pdf
Node.js.pdfNode.js.pdf
Node.js.pdf
gulfam ali
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 

Ähnlich wie 02 Node introduction (20)

All You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdfAll You Need to Know About Using Node.pdf
All You Need to Know About Using Node.pdf
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
 
Node.js Web Development.pdf
Node.js Web Development.pdfNode.js Web Development.pdf
Node.js Web Development.pdf
 
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous  Blocking or synchronous.pdfNode Js Non-blocking or asynchronous  Blocking or synchronous.pdf
Node Js Non-blocking or asynchronous Blocking or synchronous.pdf
 
Node.js.pdf
Node.js.pdfNode.js.pdf
Node.js.pdf
 
Nodejs
NodejsNodejs
Nodejs
 
Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
 
Nodejs
NodejsNodejs
Nodejs
 
Node.js and Enterprise Web Apps: Know all About it
Node.js and Enterprise Web Apps: Know all About itNode.js and Enterprise Web Apps: Know all About it
Node.js and Enterprise Web Apps: Know all About it
 
Node, express & sails
Node, express & sailsNode, express & sails
Node, express & sails
 
What is Node.js_ Where, When & How To Use It.pdf
What is Node.js_ Where, When & How To Use It.pdfWhat is Node.js_ Where, When & How To Use It.pdf
What is Node.js_ Where, When & How To Use It.pdf
 
Node js
Node jsNode js
Node js
 
Quick introduction to nodeJs
Quick introduction to nodeJsQuick introduction to nodeJs
Quick introduction to nodeJs
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Definitive Guide to Powerful Nodejs Development.pptx
Definitive Guide to Powerful Nodejs Development.pptxDefinitive Guide to Powerful Nodejs Development.pptx
Definitive Guide to Powerful Nodejs Development.pptx
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed Assaf
 

Mehr von Ahmed Elbassel

Mehr von Ahmed Elbassel (11)

13 mongoose
13 mongoose13 mongoose
13 mongoose
 
12 mongo db_and_nodejs
12 mongo db_and_nodejs12 mongo db_and_nodejs
12 mongo db_and_nodejs
 
11 schema design & crud
11 schema design & crud11 schema design & crud
11 schema design & crud
 
10 mongo db
10 mongo db10 mongo db
10 mongo db
 
09 express, moooore
09 express, moooore09 express, moooore
09 express, moooore
 
08 express introduction
08 express introduction08 express introduction
08 express introduction
 
07 restful webservices design
07 restful webservices design07 restful webservices design
07 restful webservices design
 
06 start node coding
06 start node coding06 start node coding
06 start node coding
 
03 json for java script
03 json for java script03 json for java script
03 json for java script
 
Airbnb Java Script style guide
Airbnb Java Script style guideAirbnb Java Script style guide
Airbnb Java Script style guide
 
Story of java
Story of javaStory of java
Story of java
 

Kürzlich hochgeladen

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Kürzlich hochgeladen (20)

Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 

02 Node introduction

  • 1. Node.JS Introduction Ahmed Elbassel Email: elbassel.n13@gmail.com Skype: ahmed_elbassel
  • 2. Agenda Story of Node Js V8 JavaScript Engine Platform Vs Framework What is node? What Is Node not? Blocking code Asynchronous: the browser Asynchronous: the server Event Loop Modularity Installing
  • 3. Story of Node Js Inventor: Ryan Dahl Ryan Dahl is a math student but he decided to go with programming.
  • 4. Story of Node Js Once upon a time he was uploading image using flickr, and there is was no status bar. And that was the push to Node JS creation.
  • 5. V8 JavaScript Engine V8 is Google's open source JavaScript engine. V8 is written in C++ and is used in Google Chrome, the open source browser from Google. V8 can run standalone, or can be embedded into any C++ application.
  • 6. Platform VS Framework What is Software platform? - A software platform is, in the most general sense, whatever pre-existing environment a piece of computer software or code object is designed to run within, obeying its constraints, and making use of its facilities. What is a Software framework? - For me, it’s a tool that helps you develop application in a specific way, providing specific functions you don’t have to do everytime. - Here is an awesome example.
  • 7. What is Node.js? 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.
  • 8. What is Node.js? Built on JS: The dream of Java write once run everywhere, everyone has it now :) JS is unavoidable, you will write JS code. When AJAX has released. JS started to evolve rapidly. Moreover, because Mozilla, Microsoft, google, opera, started to develop it.
  • 9. What is Node.js? Node.js uses the Google V8 JavaScript engine to execute code, and a large percentage of the basic modules are written in JavaScript. Node.js contains a built-in library to allow applications to act as a Web server without software such as Apache HTTP Server or IIS.
  • 10. What is Node.js? Node.js is gaining adoption as a server-side platform and is used by Microsoft, Yahoo!, Walmart, Groupon,SAP, LinkedIn, Rakuten, PayPal,Voxer,and GoDaddy.
  • 11. What is Node.js? Dahl was guided by a few rigid principles: A Node program/process runs on a single thread, ordering execution through an event loop. Web applications are I/O intensive, so the focus should be on making I/O fast Program flow is always directed through asynchronous callbacks Complex programs should be assembled from simpler programs
  • 12. What Is Node not? ● It is not a web framework. ● For Beginners. ○ It requires more knowledge to work with it. ● Multi-threaded.
  • 13. Blocking code The most common task that any developer would do is File I/O, this being a very fundamental process : - Open a File. - Read it's contents and print. - Do something else. - For two files, suppose each file needs 5 seconds to be read.
  • 14. Blocking code Notes on the previous code: It's a blocking code, until the read operation is completed, the next lines of code is not executed. It takes 10 seconds to read both files. 5 seconds 5 seconds
  • 15. Asynchronous: the browser Node uses event-driven and non blocking I/O model. At the browser: $.get('/getData’, function(response){ console.log('my responset' + response); });
  • 16. Asynchronous: the server It brings the asynchronous model to the server too. Non-blocking code: A waiting process is a wasteful process, especially when waiting for I/O.
  • 17. Asynchronous: the server It’s non-blocking code, it’s it takes only 5 seconds to read both files: 5 seconds 5 seconds
  • 18. Event Loop What is the Event Loop? The event loop is what allows Node.js to perform non-blocking I/O operations. despite the fact that JavaScript is single-threaded — by offloading operations to the system kernel whenever possible. Since most modern kernels are multi-threaded, they can handle multiple operations executing in the background. When one of these operations completes, the kernel tells Node.js so that the appropriate callback may be added to the poll queue to eventually be executed.
  • 19. Modularity In the book The Art of Unix Programming, Eric Raymond proposed the Rule of Modularity: Developers should build a program out of simple parts connected by well defined interfaces, so problems are local, and parts of the program can be replaced in future versions to support new features. This rule aims to save time on debugging complex code that is complex, long, and unreadable.
  • 21. Installing Windows: - go to Node website: https://nodejs.org/ - download the node version based on your Windows system(32 - 64)
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. Installing Ubuntu: sudo apt-get update sudo apt-get install nodejs Then, Node.js is installed, open a new terminal and write comman node and press enter. You can write JS code there.
  • 29. Installing Mac: - Go to: https://nodejs.org/en/download/ - Click Macintosh installer to download - Double click to install - Then, Node.js is installed, open a new terminal and write command node and press enter. - You can write JS code there.