SlideShare a Scribd company logo
Node.js quick intro
Node.js
Platform for scalable network applications
servers and clients
Uses event driven, non-blocking I/O
epoll, kqueue, /dev/poll, or select
process never blocks, no deadlocks
internal event loop
Event driven platform
Non-blocking - not waiting for things to finish
Uses asynchronous platform-specific API’s
“Single-threaded” - sequential task execution
Runs synchronous API’s in threads
Node.js architecture
Based on V8
JavaScript Virtual
Machine (engine)
+ standard library
Google Chrome uses
V8 too
Event loop illustration
// event loop
while (true) {
lock (queue) {
var tickEvents = copy(queue);
queue.empty();
}
for (var i = 0; i < tickEvents.length; i++) {
InvokeJSFunction(tickEvents[i]);
}
}
// thread-safe event pushing
lock (queue) {
queue.push(event);
}
// io call
fs.readFile(“pwd”, function(e, d){
console.log(“file data:”, d);
});
Callbacks
var fs = require(“fs”);
var cb = function(err, data){
if (err) throw err;
console.log(“File contents: ” + data);
}
fs.readFile(“pwd1”, cb);
fs.readFile(“pwd2”, cb);
Http server app
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Worldn');
}).listen(1337, "127.0.0.1");
Node.js launching
$ echo ‘console.log(“hey there”)’ | node
$ node app.js
Workers event loop
That was quick Node.js introduction
Thanks

More Related Content

PPTX
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
PPTX
Lecture android best practices
PPTX
#2 integration + ui tests
ODP
Jenkins Pipelining and Gatling Integration
PPTX
Spring Testing, Fight for the Context
PPT
Part6 introducing the jas forge collaborative project
PPTX
Introduction to Containers & Diving a little deeper into the benefits of Con...
PPTX
Testing Microservices
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Lecture android best practices
#2 integration + ui tests
Jenkins Pipelining and Gatling Integration
Spring Testing, Fight for the Context
Part6 introducing the jas forge collaborative project
Introduction to Containers & Diving a little deeper into the benefits of Con...
Testing Microservices

What's hot (20)

PDF
Blazor, lo sapevi che...
PPT
Presentation 1 open source tools in continuous integration environment v1.0
PDF
Jenkins – przyjaciel każdego testera.
PPT
Selenium2 and Jenkins: Almost pain-free UI Testing
PPTX
Ci jenkins maven svn
PDF
Delivery Pipeline for Windows Machines
PPT
Selenium
PPTX
Continuous integration with Jenkins
PDF
Asec r01-resting-on-your-laurels-will-get-you-pwned
PDF
Testing Web Apps with Spring Framework
PPT
Part 3 JasForge the collaborative and agile project v1.0
PPTX
BDD using Cucumber JVM
PPTX
PDF
Finally, easy integration testing with Testcontainers
PDF
Docker in a JS Developer’s Life
PPTX
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
PPTX
The_Little_Jenkinsfile_That_Could
PPTX
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
PDF
Test automation - Building effective solutions
Blazor, lo sapevi che...
Presentation 1 open source tools in continuous integration environment v1.0
Jenkins – przyjaciel każdego testera.
Selenium2 and Jenkins: Almost pain-free UI Testing
Ci jenkins maven svn
Delivery Pipeline for Windows Machines
Selenium
Continuous integration with Jenkins
Asec r01-resting-on-your-laurels-will-get-you-pwned
Testing Web Apps with Spring Framework
Part 3 JasForge the collaborative and agile project v1.0
BDD using Cucumber JVM
Finally, easy integration testing with Testcontainers
Docker in a JS Developer’s Life
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
The_Little_Jenkinsfile_That_Could
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Test automation - Building effective solutions
Ad

Viewers also liked (6)

PDF
Library of-the-living-dead-online-edition
PDF
Le guide des droits d'auteur chez MyPACES
PDF
Le Marathon des Mots
PPT
Improve Development Process with Open Source Software
PDF
Catalogue F. Iniciativas Canada
PPTX
Continuous Integration and development environment approach
Library of-the-living-dead-online-edition
Le guide des droits d'auteur chez MyPACES
Le Marathon des Mots
Improve Development Process with Open Source Software
Catalogue F. Iniciativas Canada
Continuous Integration and development environment approach
Ad

Similar to Node.js quick intro (20)

PDF
Basic Understanding and Implement of Node.js
PDF
Node intro
PDF
soft-shake.ch - Hands on Node.js
KEY
Node.js
PDF
JAX London 2015: Java vs Nodejs
PDF
Java vs. Java Script for enterprise web applications - Chris Bailey
PDF
Node.js introduction
PDF
Server Side JavaScript - You ain't seen nothing yet
PPTX
[NDC 2019] Enterprise-Grade Serverless
PPTX
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
PDF
Original slides from Ryan Dahl's NodeJs intro talk
PPTX
NodeJS
PDF
Introduction to Node.js
PDF
5.node js
PPTX
introduction to node.js
PPTX
YaJUG: What's new in GWT2
PPTX
CloudConnect 2011 - Building Highly Scalable Java Applications on Windows Azure
PPTX
Introduction Node.js
PPTX
ODP
Introduce about Nodejs - duyetdev.com
Basic Understanding and Implement of Node.js
Node intro
soft-shake.ch - Hands on Node.js
Node.js
JAX London 2015: Java vs Nodejs
Java vs. Java Script for enterprise web applications - Chris Bailey
Node.js introduction
Server Side JavaScript - You ain't seen nothing yet
[NDC 2019] Enterprise-Grade Serverless
[NDC 2019] Functions 2.0: Enterprise-Grade Serverless
Original slides from Ryan Dahl's NodeJs intro talk
NodeJS
Introduction to Node.js
5.node js
introduction to node.js
YaJUG: What's new in GWT2
CloudConnect 2011 - Building Highly Scalable Java Applications on Windows Azure
Introduction Node.js
Introduce about Nodejs - duyetdev.com

Recently uploaded (20)

PDF
System and Network Administraation Chapter 3
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Digital Strategies for Manufacturing Companies
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
AI in Product Development-omnex systems
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
top salesforce developer skills in 2025.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Transform Your Business with a Software ERP System
PDF
medical staffing services at VALiNTRY
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
System and Network Administration Chapter 2
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
System and Network Administraation Chapter 3
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Digital Strategies for Manufacturing Companies
Odoo Companies in India – Driving Business Transformation.pdf
AI in Product Development-omnex systems
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
VVF-Customer-Presentation2025-Ver1.9.pptx
L1 - Introduction to python Backend.pptx
top salesforce developer skills in 2025.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
How to Migrate SBCGlobal Email to Yahoo Easily
Transform Your Business with a Software ERP System
medical staffing services at VALiNTRY
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Wondershare Filmora 15 Crack With Activation Key [2025
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
System and Network Administration Chapter 2
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...

Node.js quick intro

  • 2. Node.js Platform for scalable network applications servers and clients Uses event driven, non-blocking I/O epoll, kqueue, /dev/poll, or select process never blocks, no deadlocks internal event loop
  • 3. Event driven platform Non-blocking - not waiting for things to finish Uses asynchronous platform-specific API’s “Single-threaded” - sequential task execution Runs synchronous API’s in threads
  • 4. Node.js architecture Based on V8 JavaScript Virtual Machine (engine) + standard library Google Chrome uses V8 too
  • 5. Event loop illustration // event loop while (true) { lock (queue) { var tickEvents = copy(queue); queue.empty(); } for (var i = 0; i < tickEvents.length; i++) { InvokeJSFunction(tickEvents[i]); } } // thread-safe event pushing lock (queue) { queue.push(event); } // io call fs.readFile(“pwd”, function(e, d){ console.log(“file data:”, d); });
  • 6. Callbacks var fs = require(“fs”); var cb = function(err, data){ if (err) throw err; console.log(“File contents: ” + data); } fs.readFile(“pwd1”, cb); fs.readFile(“pwd2”, cb);
  • 7. Http server app var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(1337, "127.0.0.1");
  • 8. Node.js launching $ echo ‘console.log(“hey there”)’ | node $ node app.js
  • 10. That was quick Node.js introduction Thanks