SlideShare a Scribd company logo
Server-side JS Framework:
NodeJS
callback function
• A callback function is a function which is:
• accessible by another function, and
• is invoked after the first function if that first function completes
• This construct is very useful for asynchronous behaviour where we want an
activity to take place whenever a previous event completes.
• In JavaScript, pass a function as an argument to a function. This function
that is passed as an argument inside of another function is called a callback
function. For example,
<html>
<head>
<script>
function greet(name, callback)
{ document.write("<h1>" + 'Hi' + ' ' + name + "</h1>");
callback();
}
function callMe()
{ document.write("<h1>" + 'I am callback function' + "</h1>");
}
greet('Peter', callMe);
</script> </head> <body> </body> </html>
Benefit of Callback Function
• wait for the result of a previous function call and then execute another
function call.
• In this example, we are going to use the setTimeout() method to mimic the
program that takes time to execute, such as data coming from the server.
<script>
alert(1);
setTimeout(() => alert(2), 0);
alert(3);
</script>
Two types of programming models-
Synchronous and Asynchronous models
•Synchronous tasks happen in order — you must finish
task one before moving on to the next.
•Asynchronous tasks can be executed in any order, or
even simultaneously.
JavaScript
•JavaScript is dynamically typed single-threaded
interpreted languages for the Web.
•Dynamically typed language which means a variable can
hold any data type like String or Number in its lifetime and
JavaScript interpreter won’t complain about it.
•It’s single-threaded which means your JavaScript code runs
synchronously or sequentially line by line. It’s interpreted
which means you don’t need to compile your JavaScript
code.
JavaScript
•JavaScript Interpreter also called a JavaScript Engine.
•V8 is the JavaScript engine designed by Google and
used in the Google Chrome browser while
SpiderMonkey is a JavaScript engine developed by
Mozilla for their Firefox browser.
•Javascript is a single-threaded language, meaning
that just one line of code may be run at once.
•Javascript is single-threaded because, originally, it was
only a web browser scripting language created to
serve the needs of a single user on a single window
of the browser, eliminating the need for
multithreading.
What is server-side JavaScript?
•JavaScript is a single-threaded language, it knows
how to get things done one at a time.
•It can’t do asynchronous tasks or run JavaScript code
in multiple threads for efficiency.
•JavaScript is abbreviated as JS or .js/.JS (dot J S) to
state that an entity is related to JavaScript, like
Node.js or ReactJS or AngularJS.
What is server-side JavaScript?
•JavaScript is used on the web, it needs to be
secure. Hence, using JavaScript, you can’t access the
computer it is running on, like File System, IO,
Networking, etc.
What is server-side JavaScript?
• Web APIs sometimes do their job in separate thread
allowing other JavaScript code to run normally while the
job is running in the background.
• Once the job is done, it then informs the main JavaScript
thread.
• For example, setTimeout(callback, delay) function is not
part of ECMAScript specification, it is provided by the
browser to perform an asynchronous operation. The
callback function is executed in the main JavaScript thread
once delay milliseconds has elapsed.
how JavaScript runs in a browser
The concept of server-side JavaScript
•You can take any JavaScript engine, wrap inside an
application that gives a clean interface to take the user’s
JavaScript code and execute it in the JavaScript engine.
•You can also provide APIs to perform operations like File
System IO, Networking, etc. which do not run on
JavaScript engine.
how JavaScript runs on a server
Server-side JS Framework
•It provide tools and libraries that simplify
common web development tasks,
•including routing URLs to appropriate handlers,
interacting with databases, supporting sessions
and user authorization, formatting output (e.g.
HTML, JSON, XML), and improving security
against web attacks.
Introduction to Node.js
•Node.js is an open-source server side runtime environment
built on Chrome's V8 JavaScript engine.
•It provides an event driven, non-blocking
(asynchronous) I/O and cross-platform runtime
environment for building highly scalable server-
side applications using JavaScript.
Node.js
•Node.js is nothing but JavaScript running on the
server
•Node JS is asynchronous and event-driven
JavaScript runtime build for scalable network
applications.
•Although JavaScript in web browser is single thread
and synchronous,
•Node JS is asynchronous and can use multi threads
for I/O or others tasks in background.
Introduction to Node.js
• Node.js is an open-source and cross-platform runtime
environment for executing JavaScript code outside a
browser.
• NodeJS is not a framework and it’s not a programming
language.
Node.js = Runtime Environment + JavaScript Library
Needs of Node.js
• Enables JavaScript to run outside the browser
• Makes use of Google's V8 VM for interpreting JavaScript
• Additional modules which simplifies JavaScript development
• It’s a runtime and also a library!
• JavaScript is an event-driven language, and Node takes this as an advantage to
produce highly scalable servers, using an architecture called an event loop.
• For Creating High Performance Servers.
• Non-Blocking I/O.
• Event and Callback based.
• Only one Thread and one call stack
Node JS based applications
• Web Application Development.
• Hybrid Apps Development. (Both Desktop & Mobile)
• API Development.
• Chat Applications.
• Streaming Services for Video and Audio.
Node JS Based Web Servers
• Netflix
• Linkedin
• Uber
• Paypal
• Nasa
• Medium
• Slack
• Twitter
• Free Charge
• Flipkart Seller
Node JS Based Desktop Applications
• VS Code
• Brackets
• Atom
• MongoDB Compass
• Postman
• Discord
• Dropbox
• Figma
• Github Desktop
• Microsoft Teams
• Skype
• Wordpress Desktop
• Whatsapp for Desktop
• Facebook Messenger for Desktop
Node.js Installation Procedure
steps to setup development environment to develop a Node.js application.
tools/SDK are required for developing a
Node.js application on any platform
•Node.js
•Node Package Manager (NPM)
•IDE (Integrated Development Environment) or
TextEditor
Install Node.js on Windows
•official web site https://nodejs.org.
•It will automatically detect OS and display download
link as per your Operating System.
•For example, it will display following download link for
64 bit Windows OS.
concept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJS
concept of server-side JavaScript / JS Framework: NODEJS
Verify Installation
concept of server-side JavaScript / JS Framework: NODEJS
Install Node.js on Mac/Linux
concept of server-side JavaScript / JS Framework: NODEJS
After installation, verify the Node.js installation using terminal window and enter
the following command. It will display the version number of Node.js installed on
your Mac.
$ node -v
Node.js Console/REPL
Node.js comes with virtual environment called REPL (aka Node shell). REPL stands for Read-Eval-Print-Loop. It is a quick and
easy way to test simple Node.js/JavaScript code.
To launch the REPL (Node shell), open command prompt (in Windows) or terminal (in Mac or UNIX/Linux) and type node
as shown below. It will change the prompt to > in Windows and MAC.
concept of server-side JavaScript / JS Framework: NODEJS
If you need to write multi line JavaScript expression or function then just press Enter whenever you want to write
something in the next line as a continuation of your code. The REPL terminal will display three dots (...), it means
you can continue on next line. Write .break to get out of continuity mode.
To exit from the REPL terminal, press Ctrl + C
twice or write .exit and press Enter.
JavaScript file
• 1. create a sample.js file through text editior / notepad
• 2. with in sample.js file - type
console.log("Hello World");
3. Save your file again
4. Open cmd - Move to file location
5. Executing the node filename
node sample.js

More Related Content

Similar to concept of server-side JavaScript / JS Framework: NODEJS (20)

Proposal
ProposalProposal
Proposal
Constantine Priemski
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
SachinSingh217687
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
Kalp Corporate
 
Javascript pdf for beginners easy levell
Javascript pdf for beginners easy levellJavascript pdf for beginners easy levell
Javascript pdf for beginners easy levell
SakshamGupta957136
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
slire
 
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
PSK Technolgies Pvt. Ltd. IT Company Nagpur
 
Node J pdf.docx
Node J pdf.docxNode J pdf.docx
Node J pdf.docx
PSK Technolgies Pvt. Ltd. IT Company Nagpur
 
Java ScriptingJava Scripting: One VM, Many Languages
Java ScriptingJava Scripting: One VM, Many LanguagesJava ScriptingJava Scripting: One VM, Many Languages
Java ScriptingJava Scripting: One VM, Many Languages
elliando dias
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami Sayar
FITC
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
Kasey McCurdy
 
Isomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master ClassIsomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master Class
Spike Brehm
 
Node js internal
Node js internalNode js internal
Node js internal
Chinh Ngo Nguyen
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
JohnLagman3
 
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
Node jsNode js
Node js
Rohan Chandane
 
Real time web
Real time webReal time web
Real time web
Medhat Dawoud
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
Ganesh Kondal
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
Jibanananda Sana
 
Nodejs
NodejsNodejs
Nodejs
Bhushan Patil
 
Kalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect GuideKalp Corporate Node JS Perfect Guide
Kalp Corporate Node JS Perfect Guide
Kalp Corporate
 
Javascript pdf for beginners easy levell
Javascript pdf for beginners easy levellJavascript pdf for beginners easy levell
Javascript pdf for beginners easy levell
SakshamGupta957136
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
slire
 
Java ScriptingJava Scripting: One VM, Many Languages
Java ScriptingJava Scripting: One VM, Many LanguagesJava ScriptingJava Scripting: One VM, Many Languages
Java ScriptingJava Scripting: One VM, Many Languages
elliando dias
 
Node.js 101 with Rami Sayar
Node.js 101 with Rami SayarNode.js 101 with Rami Sayar
Node.js 101 with Rami Sayar
FITC
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
Kasey McCurdy
 
Isomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master ClassIsomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master Class
Spike Brehm
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
 
8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
JohnLagman3
 
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
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
Ganesh Kondal
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
Jibanananda Sana
 

More from Kongu Engineering College, Perundurai, Erode (20)

Introduction to Generative AI refers to a subset of artificial intelligence
Introduction to Generative AI refers to a subset of artificial intelligenceIntroduction to Generative AI refers to a subset of artificial intelligence
Introduction to Generative AI refers to a subset of artificial intelligence
Kongu Engineering College, Perundurai, Erode
 
Introduction to Microsoft Power BI is a business analytics service
Introduction to Microsoft Power BI is a business analytics serviceIntroduction to Microsoft Power BI is a business analytics service
Introduction to Microsoft Power BI is a business analytics service
Kongu Engineering College, Perundurai, Erode
 
Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...
Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...
Connect to NoSQL Database (MongoDB) using Node JS & Connect Node.js with NoSQ...
Kongu Engineering College, Perundurai, Erode
 
Node.js web-based Example :Run a local server in order to start using node.js...
Node.js web-based Example :Run a local server in order to start using node.js...Node.js web-based Example :Run a local server in order to start using node.js...
Node.js web-based Example :Run a local server in order to start using node.js...
Kongu Engineering College, Perundurai, Erode
 
Concepts of Satellite Communication and types and its applications
Concepts of Satellite Communication  and types and its applicationsConcepts of Satellite Communication  and types and its applications
Concepts of Satellite Communication and types and its applications
Kongu Engineering College, Perundurai, Erode
 
Concepts of Mobile Communication Wireless LANs, Bluetooth , HiperLAN
Concepts of Mobile Communication Wireless LANs, Bluetooth , HiperLANConcepts of Mobile Communication Wireless LANs, Bluetooth , HiperLAN
Concepts of Mobile Communication Wireless LANs, Bluetooth , HiperLAN
Kongu Engineering College, Perundurai, Erode
 
Web Technology Introduction framework.pptx
Web Technology Introduction framework.pptxWeb Technology Introduction framework.pptx
Web Technology Introduction framework.pptx
Kongu Engineering College, Perundurai, Erode
 
Computer Network - Unicast Routing Distance vector Link state vector
Computer Network - Unicast Routing Distance vector Link state vectorComputer Network - Unicast Routing Distance vector Link state vector
Computer Network - Unicast Routing Distance vector Link state vector
Kongu Engineering College, Perundurai, Erode
 
Android SQLite database oriented application development
Android SQLite database oriented application developmentAndroid SQLite database oriented application development
Android SQLite database oriented application development
Kongu Engineering College, Perundurai, Erode
 
Android Application Development Programming
Android Application Development ProgrammingAndroid Application Development Programming
Android Application Development Programming
Kongu Engineering College, Perundurai, Erode
 
Introduction to Spring & Spring BootFramework
Introduction to Spring  & Spring BootFrameworkIntroduction to Spring  & Spring BootFramework
Introduction to Spring & Spring BootFramework
Kongu Engineering College, Perundurai, Erode
 
A REST API (also called a RESTful API or RESTful web API) is an application p...
A REST API (also called a RESTful API or RESTful web API) is an application p...A REST API (also called a RESTful API or RESTful web API) is an application p...
A REST API (also called a RESTful API or RESTful web API) is an application p...
Kongu Engineering College, Perundurai, Erode
 
SOA and Monolith Architecture - Micro Services.pptx
SOA and Monolith Architecture - Micro Services.pptxSOA and Monolith Architecture - Micro Services.pptx
SOA and Monolith Architecture - Micro Services.pptx
Kongu Engineering College, Perundurai, Erode
 
Application Layer.pptx
Application Layer.pptxApplication Layer.pptx
Application Layer.pptx
Kongu Engineering College, Perundurai, Erode
 
Connect to NoSQL Database using Node JS.pptx
Connect to NoSQL Database using Node JS.pptxConnect to NoSQL Database using Node JS.pptx
Connect to NoSQL Database using Node JS.pptx
Kongu Engineering College, Perundurai, Erode
 
Node_basics.pptx
Node_basics.pptxNode_basics.pptx
Node_basics.pptx
Kongu Engineering College, Perundurai, Erode
 
Navigation Bar.pptx
Navigation Bar.pptxNavigation Bar.pptx
Navigation Bar.pptx
Kongu Engineering College, Perundurai, Erode
 
Bootstarp installation.pptx
Bootstarp installation.pptxBootstarp installation.pptx
Bootstarp installation.pptx
Kongu Engineering College, Perundurai, Erode
 
nested_Object as Parameter & Recursion_Later_commamd.pptx
nested_Object as Parameter  & Recursion_Later_commamd.pptxnested_Object as Parameter  & Recursion_Later_commamd.pptx
nested_Object as Parameter & Recursion_Later_commamd.pptx
Kongu Engineering College, Perundurai, Erode
 
Chapter 3.pdf
Chapter 3.pdfChapter 3.pdf
Chapter 3.pdf
Kongu Engineering College, Perundurai, Erode
 
Ad

Recently uploaded (20)

Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Ben Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding WorldBen Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding World
AWS Chicago
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025
Suyash Joshi
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUEIntroduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Ben Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding WorldBen Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding World
AWS Chicago
 
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and ImplementationAI Agents in Logistics and Supply Chain Applications Benefits and Implementation
AI Agents in Logistics and Supply Chain Applications Benefits and Implementation
Christine Shepherd
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Trends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary MeekerTrends Artificial Intelligence - Mary Meeker
Trends Artificial Intelligence - Mary Meeker
Clive Dickens
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025
Suyash Joshi
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.Introduction to Internet of things .ppt.
Introduction to Internet of things .ppt.
hok12341073
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
Ad

concept of server-side JavaScript / JS Framework: NODEJS

  • 2. callback function • A callback function is a function which is: • accessible by another function, and • is invoked after the first function if that first function completes • This construct is very useful for asynchronous behaviour where we want an activity to take place whenever a previous event completes.
  • 3. • In JavaScript, pass a function as an argument to a function. This function that is passed as an argument inside of another function is called a callback function. For example, <html> <head> <script> function greet(name, callback) { document.write("<h1>" + 'Hi' + ' ' + name + "</h1>"); callback(); } function callMe() { document.write("<h1>" + 'I am callback function' + "</h1>"); } greet('Peter', callMe); </script> </head> <body> </body> </html>
  • 4. Benefit of Callback Function • wait for the result of a previous function call and then execute another function call. • In this example, we are going to use the setTimeout() method to mimic the program that takes time to execute, such as data coming from the server. <script> alert(1); setTimeout(() => alert(2), 0); alert(3); </script>
  • 5. Two types of programming models- Synchronous and Asynchronous models •Synchronous tasks happen in order — you must finish task one before moving on to the next. •Asynchronous tasks can be executed in any order, or even simultaneously.
  • 6. JavaScript •JavaScript is dynamically typed single-threaded interpreted languages for the Web. •Dynamically typed language which means a variable can hold any data type like String or Number in its lifetime and JavaScript interpreter won’t complain about it. •It’s single-threaded which means your JavaScript code runs synchronously or sequentially line by line. It’s interpreted which means you don’t need to compile your JavaScript code.
  • 7. JavaScript •JavaScript Interpreter also called a JavaScript Engine. •V8 is the JavaScript engine designed by Google and used in the Google Chrome browser while SpiderMonkey is a JavaScript engine developed by Mozilla for their Firefox browser.
  • 8. •Javascript is a single-threaded language, meaning that just one line of code may be run at once. •Javascript is single-threaded because, originally, it was only a web browser scripting language created to serve the needs of a single user on a single window of the browser, eliminating the need for multithreading.
  • 9. What is server-side JavaScript? •JavaScript is a single-threaded language, it knows how to get things done one at a time. •It can’t do asynchronous tasks or run JavaScript code in multiple threads for efficiency. •JavaScript is abbreviated as JS or .js/.JS (dot J S) to state that an entity is related to JavaScript, like Node.js or ReactJS or AngularJS.
  • 10. What is server-side JavaScript? •JavaScript is used on the web, it needs to be secure. Hence, using JavaScript, you can’t access the computer it is running on, like File System, IO, Networking, etc.
  • 11. What is server-side JavaScript? • Web APIs sometimes do their job in separate thread allowing other JavaScript code to run normally while the job is running in the background. • Once the job is done, it then informs the main JavaScript thread. • For example, setTimeout(callback, delay) function is not part of ECMAScript specification, it is provided by the browser to perform an asynchronous operation. The callback function is executed in the main JavaScript thread once delay milliseconds has elapsed.
  • 12. how JavaScript runs in a browser
  • 13. The concept of server-side JavaScript •You can take any JavaScript engine, wrap inside an application that gives a clean interface to take the user’s JavaScript code and execute it in the JavaScript engine. •You can also provide APIs to perform operations like File System IO, Networking, etc. which do not run on JavaScript engine.
  • 14. how JavaScript runs on a server
  • 15. Server-side JS Framework •It provide tools and libraries that simplify common web development tasks, •including routing URLs to appropriate handlers, interacting with databases, supporting sessions and user authorization, formatting output (e.g. HTML, JSON, XML), and improving security against web attacks.
  • 16. Introduction to Node.js •Node.js is an open-source server side runtime environment built on Chrome's V8 JavaScript engine. •It provides an event driven, non-blocking (asynchronous) I/O and cross-platform runtime environment for building highly scalable server- side applications using JavaScript.
  • 17. Node.js •Node.js is nothing but JavaScript running on the server •Node JS is asynchronous and event-driven JavaScript runtime build for scalable network applications. •Although JavaScript in web browser is single thread and synchronous, •Node JS is asynchronous and can use multi threads for I/O or others tasks in background.
  • 18. Introduction to Node.js • Node.js is an open-source and cross-platform runtime environment for executing JavaScript code outside a browser. • NodeJS is not a framework and it’s not a programming language. Node.js = Runtime Environment + JavaScript Library
  • 19. Needs of Node.js • Enables JavaScript to run outside the browser • Makes use of Google's V8 VM for interpreting JavaScript • Additional modules which simplifies JavaScript development • It’s a runtime and also a library! • JavaScript is an event-driven language, and Node takes this as an advantage to produce highly scalable servers, using an architecture called an event loop. • For Creating High Performance Servers. • Non-Blocking I/O. • Event and Callback based. • Only one Thread and one call stack
  • 20. Node JS based applications • Web Application Development. • Hybrid Apps Development. (Both Desktop & Mobile) • API Development. • Chat Applications. • Streaming Services for Video and Audio.
  • 21. Node JS Based Web Servers • Netflix • Linkedin • Uber • Paypal • Nasa • Medium • Slack • Twitter • Free Charge • Flipkart Seller
  • 22. Node JS Based Desktop Applications • VS Code • Brackets • Atom • MongoDB Compass • Postman • Discord • Dropbox • Figma • Github Desktop • Microsoft Teams • Skype • Wordpress Desktop • Whatsapp for Desktop • Facebook Messenger for Desktop
  • 23. Node.js Installation Procedure steps to setup development environment to develop a Node.js application.
  • 24. tools/SDK are required for developing a Node.js application on any platform •Node.js •Node Package Manager (NPM) •IDE (Integrated Development Environment) or TextEditor
  • 25. Install Node.js on Windows •official web site https://nodejs.org. •It will automatically detect OS and display download link as per your Operating System. •For example, it will display following download link for 64 bit Windows OS.
  • 34. Install Node.js on Mac/Linux
  • 36. After installation, verify the Node.js installation using terminal window and enter the following command. It will display the version number of Node.js installed on your Mac. $ node -v
  • 38. Node.js comes with virtual environment called REPL (aka Node shell). REPL stands for Read-Eval-Print-Loop. It is a quick and easy way to test simple Node.js/JavaScript code. To launch the REPL (Node shell), open command prompt (in Windows) or terminal (in Mac or UNIX/Linux) and type node as shown below. It will change the prompt to > in Windows and MAC.
  • 40. If you need to write multi line JavaScript expression or function then just press Enter whenever you want to write something in the next line as a continuation of your code. The REPL terminal will display three dots (...), it means you can continue on next line. Write .break to get out of continuity mode.
  • 41. To exit from the REPL terminal, press Ctrl + C twice or write .exit and press Enter.
  • 42. JavaScript file • 1. create a sample.js file through text editior / notepad • 2. with in sample.js file - type console.log("Hello World"); 3. Save your file again 4. Open cmd - Move to file location 5. Executing the node filename node sample.js