SlideShare a Scribd company logo
Full-Stack JavaScriptFull-Stack JavaScript
An introduction to Node.jsAn introduction to Node.js
When we speak aboutWhen we speak about
JavaScript …JavaScript …
JavaScript isJavaScript is StrangeStrange
console.log(1 == true); // true
console.log(1 === true); // false
console.log("0" == false); // true
console.log("abc" == "a" + "b" + "c"); // true
console.log(null == undefined); // true
console.log(30 - "7"); // 23
console.log("30" + 7); // 307
JavaScript is even moreJavaScript is even more
StrangeStrange
function rectangle(x,y) {
this.x = x;
this.y = y;
}
rectangle.prototype.area = function() {
return this.x * this.y;
}
var twoByThree = new rectangle(2,3);
console.log(twoByThree.area());
But… JavaScript is relevant!But… JavaScript is relevant!
What is Node.jsWhat is Node.js
““Node.js is a platform built on Chrome's JavaScriptNode.js is a platform built on Chrome's JavaScript
runtime for easily building fast, scalable networkruntime for easily building fast, scalable network
applications. Node.js uses an event-driven, non-applications. Node.js uses an event-driven, non-
blocking I/O model that makes it lightweight andblocking I/O model that makes it lightweight and
efficient, perfect for data-intensive real-timeefficient, perfect for data-intensive real-time
applications that run across distributed devices.”applications that run across distributed devices.”
- from nodejs.org
Node.js event loopNode.js event loop
Non-blocking I/ONon-blocking I/O
I/O block execution until finished
I/O doesn’t block execution
var data = $.post('/resource.json');
console.log(data);
$.post('/resource.json', function (data) {
console.log(data);
});
// script execution continues
Now we have an incrediblyNow we have an incredibly
fast platformfast platform
Overview of the layers thatOverview of the layers that
make up a Node applicationmake up a Node application
V8 thread pool
(libeio)
event loop
(libev)
crypto
(OpenSSL)
DNS
(c-ares)
Node core
querystring, http, socket, file system,
low-level HTTP parser, low-level TCP server
Community modules
node-formidable, node-cgi, mongoose, socket.io,
express, connect, database drivers, middleware, routing,
etc…
Application logic
http.createServer(), app.use(), route handlers,
directory structures, business algorithms
A simple file serverA simple file server
var http = require("http");
var server = http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Worldn')
});
server.listen(3000);
console.log('Server running at http://localhost:3000/');
Node Package ManagerNode Package Manager
(NPM)(NPM)
• www.npmjs.org
• 60.000+ modules
• package.json file (npm init)
• npm install <module.name> --save
Popular Node.js modulesPopular Node.js modules
 Express - Express.js, a simple web 
development framework for Node.js, and the 
de-facto standard for the majority of Node.js 
applications out there today.
 connect - Connect is an extensible HTTP server 
framework for Node.js, providing a collection of 
high performance middleware components.
 socket.io - Server-side component of the two 
most common websockets components out 
there today.
Local modulesLocal modules
exports.world = function () {
console.log("Hello World");
};
var hello = require("./hello");
hello.world();
Node.js is Node.js is notnot a silver-bullet new platform that will a silver-bullet new platform that will 
dominate the web development world. Instead, it’s adominate the web development world. Instead, it’s a
platform that fills a particular need.platform that fills a particular need.
When to NOT use Node.jsWhen to NOT use Node.js
• When you are doing heavy and CPU intensive
calculations on server side, because event-loops are
CPU hungry.
• Node.js with a relational DB behind. Relational DB
tools for Node.js are still in their early stages.
When to use Node.jsWhen to use Node.js
• Node.js is good for creating streaming based real-
time services, web chat applications, static file
servers etc.
• If you need high level concurrency and not worried
about CPU-cycles.
• Node.js with Express.js can also be used to create
classic web applications on the server-side.
Suddenly, every startup on Earth could reuseSuddenly, every startup on Earth could reuse
developers (i.e., resources) on both the client- anddevelopers (i.e., resources) on both the client- and
server-side, solving the "Python Guru Needed" job postserver-side, solving the "Python Guru Needed" job post
problem.problem.
Full-Stack JavaScriptFull-Stack JavaScript
Angular.js
Node.js
Grunt
Mocha
Jasmine.js
DemoDemo
ResourcesResources
• Source Code
https://github.com/lehmamic/fullstack-javascript
• Node.js in Action
Ad

More Related Content

What's hot (20)

Hujs 总结
Hujs 总结Hujs 总结
Hujs 总结
yiming he
 
JavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyJavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovy
Yasuharu Nakano
 
Streams in Node.js
Streams in Node.jsStreams in Node.js
Streams in Node.js
Sebastian Springer
 
Python queue solution with asyncio and kafka
Python queue solution with asyncio and kafkaPython queue solution with asyncio and kafka
Python queue solution with asyncio and kafka
Ondřej Veselý
 
Bs webgl소모임004
Bs webgl소모임004Bs webgl소모임004
Bs webgl소모임004
Seonki Paik
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervoso
Luis Vendrame
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseCodepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Sages
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
Simon Su
 
Debugging JavaScript with Chrome
Debugging JavaScript with ChromeDebugging JavaScript with Chrome
Debugging JavaScript with Chrome
Igor Zalutsky
 
PyCon KR 2019 sprint - RustPython by example
PyCon KR 2019 sprint  - RustPython by examplePyCon KR 2019 sprint  - RustPython by example
PyCon KR 2019 sprint - RustPython by example
YunWon Jeong
 
Профилирование и оптимизация производительности Ruby-кода
Профилирование и оптимизация производительности Ruby-кодаПрофилирование и оптимизация производительности Ruby-кода
Профилирование и оптимизация производительности Ruby-кода
samsolutionsby
 
Azure Durable Funkiness - .NET Oxford June 2018
Azure Durable Funkiness - .NET Oxford June 2018Azure Durable Funkiness - .NET Oxford June 2018
Azure Durable Funkiness - .NET Oxford June 2018
Stuart Leeks
 
Azure sql insert perf
Azure sql insert perfAzure sql insert perf
Azure sql insert perf
Mornè Blake
 
Cluj Big Data Meetup - Big Data in Practice
Cluj Big Data Meetup - Big Data in PracticeCluj Big Data Meetup - Big Data in Practice
Cluj Big Data Meetup - Big Data in Practice
Steffen Wenz
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.js
Mike Hagedorn
 
Introduction of ES2015
Introduction of ES2015Introduction of ES2015
Introduction of ES2015
Nakajima Shigeru
 
2 docker engine_hands_on
2 docker engine_hands_on2 docker engine_hands_on
2 docker engine_hands_on
FEG
 
Arp
ArpArp
Arp
Ebsil Sherly
 
Interactive subway map
Interactive subway mapInteractive subway map
Interactive subway map
Konstantin Chukhlomin
 
PyData Berlin Meetup
PyData Berlin MeetupPyData Berlin Meetup
PyData Berlin Meetup
Steffen Wenz
 
JavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovyJavaSE7 Launch Event: Java7xGroovy
JavaSE7 Launch Event: Java7xGroovy
Yasuharu Nakano
 
Python queue solution with asyncio and kafka
Python queue solution with asyncio and kafkaPython queue solution with asyncio and kafka
Python queue solution with asyncio and kafka
Ondřej Veselý
 
Bs webgl소모임004
Bs webgl소모임004Bs webgl소모임004
Bs webgl소모임004
Seonki Paik
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervoso
Luis Vendrame
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseCodepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Sages
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
Simon Su
 
Debugging JavaScript with Chrome
Debugging JavaScript with ChromeDebugging JavaScript with Chrome
Debugging JavaScript with Chrome
Igor Zalutsky
 
PyCon KR 2019 sprint - RustPython by example
PyCon KR 2019 sprint  - RustPython by examplePyCon KR 2019 sprint  - RustPython by example
PyCon KR 2019 sprint - RustPython by example
YunWon Jeong
 
Профилирование и оптимизация производительности Ruby-кода
Профилирование и оптимизация производительности Ruby-кодаПрофилирование и оптимизация производительности Ruby-кода
Профилирование и оптимизация производительности Ruby-кода
samsolutionsby
 
Azure Durable Funkiness - .NET Oxford June 2018
Azure Durable Funkiness - .NET Oxford June 2018Azure Durable Funkiness - .NET Oxford June 2018
Azure Durable Funkiness - .NET Oxford June 2018
Stuart Leeks
 
Azure sql insert perf
Azure sql insert perfAzure sql insert perf
Azure sql insert perf
Mornè Blake
 
Cluj Big Data Meetup - Big Data in Practice
Cluj Big Data Meetup - Big Data in PracticeCluj Big Data Meetup - Big Data in Practice
Cluj Big Data Meetup - Big Data in Practice
Steffen Wenz
 
Playing With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.jsPlaying With Fire - An Introduction to Node.js
Playing With Fire - An Introduction to Node.js
Mike Hagedorn
 
2 docker engine_hands_on
2 docker engine_hands_on2 docker engine_hands_on
2 docker engine_hands_on
FEG
 
PyData Berlin Meetup
PyData Berlin MeetupPyData Berlin Meetup
PyData Berlin Meetup
Steffen Wenz
 

Similar to Full-Stack JavaScript with Node.js (20)

NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
Apaichon Punopas
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.
Mike Brevoort
 
NodeJS
NodeJSNodeJS
NodeJS
Alok Guha
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
Tom Croucher
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
Ricardo Silva
 
Introduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comIntroduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.com
Van-Duyet Le
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
Alex Su
 
Nodejs Intro Part One
Nodejs Intro Part OneNodejs Intro Part One
Nodejs Intro Part One
Budh Ram Gurung
 
Getting Input from User
Getting Input from UserGetting Input from User
Getting Input from User
Lovely Professional University
 
Unit-2 Getting Input from User.pptx
Unit-2 Getting Input from User.pptxUnit-2 Getting Input from User.pptx
Unit-2 Getting Input from User.pptx
Lovely Professional University
 
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com GoTDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
tdc-globalcode
 
Server side JavaScript: going all the way
Server side JavaScript: going all the wayServer side JavaScript: going all the way
Server side JavaScript: going all the way
Oleg Podsechin
 
Javascript Everywhere From Nose To Tail
Javascript Everywhere From Nose To TailJavascript Everywhere From Nose To Tail
Javascript Everywhere From Nose To Tail
Cliffano Subagio
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
NodeXperts
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
Alexandre Morgaut
 
JS everywhere 2011
JS everywhere 2011JS everywhere 2011
JS everywhere 2011
Oleg Podsechin
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
soft-shake.ch
 
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
Tom Croucher
 
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
GITS Indonesia
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.
Mike Brevoort
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
Tom Croucher
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
Ricardo Silva
 
Introduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comIntroduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.com
Van-Duyet Le
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
Alex Su
 
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com GoTDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
tdc-globalcode
 
Server side JavaScript: going all the way
Server side JavaScript: going all the wayServer side JavaScript: going all the way
Server side JavaScript: going all the way
Oleg Podsechin
 
Javascript Everywhere From Nose To Tail
Javascript Everywhere From Nose To TailJavascript Everywhere From Nose To Tail
Javascript Everywhere From Nose To Tail
Cliffano Subagio
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
NodeXperts
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
Alexandre Morgaut
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
soft-shake.ch
 
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
Tom Croucher
 
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
Fundamental Node.js (Workshop bersama Front-end Developer GITS Indonesia, War...
GITS Indonesia
 
Ad

Recently uploaded (20)

Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Full Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest VersionFull Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest Version
jonesmichealj2
 
Odoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education ProcessOdoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education Process
iVenture Team LLP
 
Cryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptxCryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptx
riyageorge2024
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game DevelopmentBest Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Juego Studios
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Full Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest VersionFull Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest Version
jonesmichealj2
 
Odoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education ProcessOdoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education Process
iVenture Team LLP
 
Cryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptxCryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptx
riyageorge2024
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game DevelopmentBest Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Juego Studios
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Ad

Full-Stack JavaScript with Node.js

  • 1. Full-Stack JavaScriptFull-Stack JavaScript An introduction to Node.jsAn introduction to Node.js
  • 2. When we speak aboutWhen we speak about JavaScript …JavaScript …
  • 3. JavaScript isJavaScript is StrangeStrange console.log(1 == true); // true console.log(1 === true); // false console.log("0" == false); // true console.log("abc" == "a" + "b" + "c"); // true console.log(null == undefined); // true console.log(30 - "7"); // 23 console.log("30" + 7); // 307
  • 4. JavaScript is even moreJavaScript is even more StrangeStrange function rectangle(x,y) { this.x = x; this.y = y; } rectangle.prototype.area = function() { return this.x * this.y; } var twoByThree = new rectangle(2,3); console.log(twoByThree.area());
  • 5. But… JavaScript is relevant!But… JavaScript is relevant!
  • 6. What is Node.jsWhat is Node.js
  • 7. ““Node.js is a platform built on Chrome's JavaScriptNode.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable networkruntime for easily building fast, scalable network applications. Node.js uses an event-driven, non-applications. Node.js uses an event-driven, non- blocking I/O model that makes it lightweight andblocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-timeefficient, perfect for data-intensive real-time applications that run across distributed devices.”applications that run across distributed devices.” - from nodejs.org
  • 9. Non-blocking I/ONon-blocking I/O I/O block execution until finished I/O doesn’t block execution var data = $.post('/resource.json'); console.log(data); $.post('/resource.json', function (data) { console.log(data); }); // script execution continues
  • 10. Now we have an incrediblyNow we have an incredibly fast platformfast platform
  • 11. Overview of the layers thatOverview of the layers that make up a Node applicationmake up a Node application V8 thread pool (libeio) event loop (libev) crypto (OpenSSL) DNS (c-ares) Node core querystring, http, socket, file system, low-level HTTP parser, low-level TCP server Community modules node-formidable, node-cgi, mongoose, socket.io, express, connect, database drivers, middleware, routing, etc… Application logic http.createServer(), app.use(), route handlers, directory structures, business algorithms
  • 12. A simple file serverA simple file server var http = require("http"); var server = http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn') }); server.listen(3000); console.log('Server running at http://localhost:3000/');
  • 13. Node Package ManagerNode Package Manager (NPM)(NPM) • www.npmjs.org • 60.000+ modules • package.json file (npm init) • npm install <module.name> --save
  • 14. Popular Node.js modulesPopular Node.js modules  Express - Express.js, a simple web  development framework for Node.js, and the  de-facto standard for the majority of Node.js  applications out there today.  connect - Connect is an extensible HTTP server  framework for Node.js, providing a collection of  high performance middleware components.  socket.io - Server-side component of the two  most common websockets components out  there today.
  • 15. Local modulesLocal modules exports.world = function () { console.log("Hello World"); }; var hello = require("./hello"); hello.world();
  • 16. Node.js is Node.js is notnot a silver-bullet new platform that will a silver-bullet new platform that will  dominate the web development world. Instead, it’s adominate the web development world. Instead, it’s a platform that fills a particular need.platform that fills a particular need.
  • 17. When to NOT use Node.jsWhen to NOT use Node.js • When you are doing heavy and CPU intensive calculations on server side, because event-loops are CPU hungry. • Node.js with a relational DB behind. Relational DB tools for Node.js are still in their early stages.
  • 18. When to use Node.jsWhen to use Node.js • Node.js is good for creating streaming based real- time services, web chat applications, static file servers etc. • If you need high level concurrency and not worried about CPU-cycles. • Node.js with Express.js can also be used to create classic web applications on the server-side.
  • 19. Suddenly, every startup on Earth could reuseSuddenly, every startup on Earth could reuse developers (i.e., resources) on both the client- anddevelopers (i.e., resources) on both the client- and server-side, solving the "Python Guru Needed" job postserver-side, solving the "Python Guru Needed" job post problem.problem.

Editor's Notes

  • #2: - Ich habe mich im Zusammenhang mit Rocket.Net mit dem Thema Node.js beschäftigt. - ich werde nicht sehr tief in das Thema einsteigen, aber ich möchte euch eine Idee geben, was Node.js ist und was man damit machen kann. - Das Ziehl is schlussendlich, eine Full-Stack JavaScript Web Anwendung zu schreiben.
  • #3: Fangen wir an, warum überhaupt JavaScript? Wir mögen JavaScript eigentlich nicht und versuchen es zu vermeiden. Wem geht es so wie dieser Katze? Was mögt in an Java Script nicht? JavaScript is: - Unstructured - Not intuitive - Unlogical - Prototype inheritance… WTF! - Dynamically typed - Hard to debug - Global Vairables - IDE Integration (Intellisense)
  • #4: Beispiel: JavaScript operatoren.
  • #5: Beispiel JavaScript Klassen und Prototypes
  • #6: - THE language of the WEB - Cross-platform - Huge REACH - JavaScript is everywhere (client, server, libs, frameworks) - Single Page Applications - Server applications - End-to-End JavaScript applications
  • #7: Schauen wir Node.js mal etwas unter die Haube.
  • #8: Ich habe festgestellt, dass viele schon von Node.js gehört haben, aber nicht genau wissen, was Node.js ist. Oft wird Node.js als JavaScript HTTP Server bezeichnet, was nicht ganz korrekt ist. Schauen wir uns mal die Definition von Node.Js an. Node.js basiert auf der Google V8 Engine und ist eine Platform für event-driven, data-intensive real-time applikationen. -&amp;gt; Man merke , kein Wort von HTTP oder Server. Obwohl man Node.js sher oft als HTTP Server einsetzt. -&amp;gt; Man kann auch Konsolen Anwendungen schreiben (Viele Node.js Tools, wie zum Beispiel Grunt oder Bower, die wir auch in Rocket.Net verwenden, sind ein gutes Beispiel dazu) -&amp;gt; Es gibt sogar eine ganze JavaScript IDE (Atom.io), die auf Node.Js läuft.
  • #9: Ähnlich wie im Browser läuft JavaScript bei Node.js in einem Event-Loop. Traditional - Typically one thread per connection is used - In many cases, a thread is contained inside a process and maintains its own working memory. - Threading can tax operating system resources since threads require CPU to perform context switches, as well as additional RAM. Node.JS - Instead of using the multithreaded approach with blocking I/O, it uses an event loop with asynchronous I/O (Like the Browser). - Because of these design choices, Node.js is often able to handle more requests and connected clients, making it a more responsive solution. - In Node, I/O is almost always performed outside of the main event loop, allowing the server to stay efficient and responsive.
  • #10: Dieser Event-Loop hat jedoch einen grossen Einfluss darauf, wie wir unsere Applikationen schreiben. In einer MVC Anwendung macht es nichts aus, wenn wir blockierende I/O Befehle haben. Der aktuelle Request muss zwar warten bis der Befehl fertig ist, Die Anwendung kann jedoch weitere Requests entgegen nehmen. Bei Node.js is dies jedoch anderst. Durch den Event-Loop läuft node.js in einem einzigen Thread. Blockierende Befehle, blockieren die gesammte Node.js Anwendung. Deshalb setzt Node.js auf ein Non-Blocking &amp; Event-Driven Ansatz.
  • #11: Der Event-Loop und der Event-Driven Ansatz erhöht die Anzahl möglicher parallel verarbeiteter Requests /s und die Antwortzeit drastisch. Hier in der Graphik sieht man zum Beispiel: Bei 3500 Client-Connections kann Node.js 3 mal mehr Requests als ein herkömmlicher Webserver erarbeiten.
  • #12: Node.js liefert nur die basis “low-level” module wie einfache FileSystem I/O, TCP und HTTP Server. Node.js hat aber eine sehr starke Community, welche die high-level module Wie connect und express zur verfügung stellt. Node Core Node’s core APIs are always lightweight and low-level. This leaves opinions, syntactic sugar, and specific details up to the community modules. Community modules Community modules are where Node thrives. Community members take the low-level core APIs and create fun and easy-to-use modules that allow you to get tasks done easily. Application logic The application logic layer is where your app is implemented. The size of this layer depends on the number of community modules used and the complexity of the application.
  • #13: Dieses Beispiel ist ein simpler HTTP Server, welcher nur das basis HTTP module verwendet. Wie man sieht, ist das wirklich sehr low level, jedigliche Funktionalität muss man selber schreiben, oder auf die Community Module zugreifen.
  • #14: Diese Communit Module werden über den node package manager in die Applikation eingebunden. Jede Node.js Awendung hat ein sogenanntes “Package.json” file wo dir dependencies definiert warden. Demo (Local Project) 1. Create a folder 2. npm init 3. npm install grunt –save Demo (Global) 1. npm install –g grunt
  • #17: Ich möchte an dieser Stelle klarstellen: Node.js ist keine Silver-Bullet. Node.js füllt eine Lücke für speziefische Bedürfnisse.
  • #20: Jetzt haben wir also Node.js mit dem wir JavaScript auf der Server-Seite und auch für das Tooling verwenden können. =&amp;gt; Das hat viele Vorteile. 1. Wir können die Leute unabhängig Fachrichtung (e.g. .Net &amp; Java) in ein project stecken. 2. Wir haben keinen Sprachlichen Kontext-Switch zwischen Client &amp; Server. 3. Wir können theoretisch Code für Client &amp; Server Sharen. (nicht geschenkt, aber es gibt Ansätze wie man das machen kann)