SlideShare una empresa de Scribd logo
1 de 39
T4T Trainingsday
NodeJs
Tim Sommer
Content
• About me
• Common Js
• Node Js
• Demo(s) !
• Grunt Js
• Demo !
About me
Super Sommer !
About me
Tim Sommer (@sommertim)
>3 years @ T4T
Passion for Front-End Development
http://blog.timsommer.be
https://github.com/timsommer
Learning JavaScript used to mean you weren't a
serious software developer. Today, not learning
Javascript means the same thing.
- Tim O'Reilly
History of JavaScript
Server side JavaScript?
• Has been around for a long time
• Very fragmented:
• Netscape started server-side scripting (SSJS),
December, 1994
• Mozilla Spidermonkey, C, Firefox > 3.5,
GNOME (started at Netscape), first engine
ever, 1996
• Mozilla Rhino, Java, 1997 (started by
Netscape for navigator)
• Google V8, Chrome, September 2, 2008.
• SquirrelFish (AKA JavaScriptCore), Webkit,
June 2, 2008
Server side problems?
• No compatible standard library.
• No standard interface to connect to a database.
• No standard method to insert different modules.
• No method for packaging code for distribution and
installation.
• Module storage of a common package that solves
dependency is necessary.
Commonjs ?
• Kevin Dangoor, January 2009
• Spec
• JavaScript ecosystem for web servers, desktop and
command line apps and in the browser.
• CommonJS-compliant systems:
• Server-side JavaScript applications
• Command line tools
• Desktop GUI-based applications
• Hybrid applications (Titanium, Adobe AIR)
Why Server Side js?
• Familiar and universal
• Same language on server and client
(code sharing)
• Notions from Self, Scheme, and
Prototype - all with a C/C++/Java-like
syntax.
• Server side JavaScript has the
potential to significantly outperform
other common dynamic languages.
Why Server Side js?
Common Spec?
• Modules
• Binary strings and buffers
• Charset encodings
• Binary, buffered, and textual input and output (io) streams
• System process arguments, environment, and streams
• File system interface
• Socket streams
• Unit test assertions, running, and reporting
• Web server gateway interface, JSGI
• Local and remote packages and package management
Common Spec?
Common Spec?
AMD?
• Asynchronous module definition
• Started as offspin (fork) of CommonJs
• Failed to reach an agreement in discussions with
CommonJS about using JavaScript module in an
asynchronous situation.
• Evolved in own module definition API
• The difference in the module specifications defined by
the two territories are in module load.
Implementations
• ArangoDB (V8): NoSQL
• CouchDB (SpiderMonkey): NoSQL
• AkShell (V8): browser based IDE
• Narwhal (V8, Rhino): JavaScript platform
• Requirejs (Web Browser): module loader
• Curljs (Web browser): resource loader
• Whenjs (Web browser): async promises library
• …
• Nodejs (V8)
Nodejs?
Nodejs?
• Event-driven
• Flow is determined by events
• Event loop
• Non-blocking I/O (AKA asynchronous I/O)
• I/O processing while permitting other processing to continue
• Parallel I/O
• You can do other things while waiting.
• You can wait on more than one thing at a time.
• CommonJS
• V8
What makes nodejs Fast?
• Node.js is fast by design
• Never blocking on I/O means less threads.
• This means YOU handle scheduling.
Node – Java runtime?
Java :
Node :
Concurrent Requests Avg Response time (ms) Requests/second
10 23 422
50 119 416
100 243 408
150 363 411
Concurrent Requests Avg Response time (ms) Requests/second
10 19 509
50 109 453
100 196 507
150 294 506
Node – Apache runtime?
Apache (PHP)
Node – Apache runtime?
Node
Programming in NodeJs
CPU intensive computations
• Node -> single threaded execution
model
• Fibonacci function = one event tick
• Blocking your node server completely
• IO (DB, Filesystem) is the bottleneck,
These calls are completely async
CPU intensive computations
CPU intensive computations
• NPM Modules:
• ‘flow’, ‘async’, ‘step’ and ‘Q’.
• ‘Threads a GoGo’ natively utilizes threading inside the
V8 engine (and therefore relies on a newer release of
node.js)
• ‘Webworkers’
Programming in NodeJs
Programming in NodeJs
Demo!
Node
CPU intensive computations
NPM
• NPM (Node Package Manager)
• express
• async
• grunt
• mocha
• helmet
• socket.io
• underscore
• ……… (> 50.000)
Demo!
Building a web-app with Express
Gruntjs
Gruntjs
• Task runner in Node
• Automation
• Minification, compilation, unit testing, linting, ..
• Custom tasks!
• Commonjs Compliant
Gruntjs
People will always want to do stupid things, and luckily for
those people, there's JSHint
-Douglas Crockford
Demo!
Automated tasks with Gruntjs
Q&A ?

Más contenido relacionado

La actualidad más candente

Javantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornJavantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornMiroslav Resetar
 
Scripting with NodeJS
Scripting with NodeJSScripting with NodeJS
Scripting with NodeJSBen Pearson
 
UTMessan 2014 - Same .NET code for Windows, Linux, and OsX
UTMessan 2014 - Same .NET code for Windows, Linux, and OsXUTMessan 2014 - Same .NET code for Windows, Linux, and OsX
UTMessan 2014 - Same .NET code for Windows, Linux, and OsXDataPlato, Crossing the line
 
Grand Central Dispatch and multi-threading [iCONdev 2014]
Grand Central Dispatch and multi-threading [iCONdev 2014]Grand Central Dispatch and multi-threading [iCONdev 2014]
Grand Central Dispatch and multi-threading [iCONdev 2014]Kuba Břečka
 
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016Codemotion
 
Introduction to Napa.js
Introduction to Napa.jsIntroduction to Napa.js
Introduction to Napa.jsDaiyi Peng
 
Node.js introduction
Node.js introductionNode.js introduction
Node.js introductionPrasoon Kumar
 
Mocloudos - Feather-weight Cloud OS developed within
14 man-days
Mocloudos - Feather-weight Cloud OS developed within
14 man-daysMocloudos - Feather-weight Cloud OS developed within
14 man-days
Mocloudos - Feather-weight Cloud OS developed within
14 man-daysMasaki Muranaka
 
From Test to Live with Rex
From Test to Live with RexFrom Test to Live with Rex
From Test to Live with RexJan Gehring
 
Next generation frontend tooling
Next generation frontend toolingNext generation frontend tooling
Next generation frontend toolingpksjce
 
Ruby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterRuby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterSteven Chau
 
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
Node.js: Whats the Big Deal? Presented and JS Meetup ChicagoNode.js: Whats the Big Deal? Presented and JS Meetup Chicago
Node.js: Whats the Big Deal? Presented and JS Meetup ChicagoAziz Ali
 
Rust Programming Language
Rust Programming LanguageRust Programming Language
Rust Programming LanguageJaeju Kim
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmSkills Matter
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 

La actualidad más candente (20)

Javantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornJavantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript Nashorn
 
Let's server your Data
Let's server your DataLet's server your Data
Let's server your Data
 
Scripting with NodeJS
Scripting with NodeJSScripting with NodeJS
Scripting with NodeJS
 
UTMessan 2014 - Same .NET code for Windows, Linux, and OsX
UTMessan 2014 - Same .NET code for Windows, Linux, and OsXUTMessan 2014 - Same .NET code for Windows, Linux, and OsX
UTMessan 2014 - Same .NET code for Windows, Linux, and OsX
 
Grand Central Dispatch and multi-threading [iCONdev 2014]
Grand Central Dispatch and multi-threading [iCONdev 2014]Grand Central Dispatch and multi-threading [iCONdev 2014]
Grand Central Dispatch and multi-threading [iCONdev 2014]
 
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
 
Introduction to Napa.js
Introduction to Napa.jsIntroduction to Napa.js
Introduction to Napa.js
 
Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction
 
Mocloudos - Feather-weight Cloud OS developed within
14 man-days
Mocloudos - Feather-weight Cloud OS developed within
14 man-daysMocloudos - Feather-weight Cloud OS developed within
14 man-days
Mocloudos - Feather-weight Cloud OS developed within
14 man-days
 
From Test to Live with Rex
From Test to Live with RexFrom Test to Live with Rex
From Test to Live with Rex
 
Ruby and Security
Ruby and SecurityRuby and Security
Ruby and Security
 
Nodejs
NodejsNodejs
Nodejs
 
Next generation frontend tooling
Next generation frontend toolingNext generation frontend tooling
Next generation frontend tooling
 
Nashorn
NashornNashorn
Nashorn
 
Ruby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterRuby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles Nutter
 
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
Node.js: Whats the Big Deal? Presented and JS Meetup ChicagoNode.js: Whats the Big Deal? Presented and JS Meetup Chicago
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
 
Rust Programming Language
Rust Programming LanguageRust Programming Language
Rust Programming Language
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 

Similar a T4T Training day - NodeJS

"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)Tech in Asia ID
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVMAlex Birch
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS Ganesh Kondal
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSEugene Lazutkin
 
Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA...
Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA...Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA...
Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA...Samsung Open Source Group
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Ryan Cuprak
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5David Voyles
 
End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012Alexandre Morgaut
 
Oracle Fuson Middleware Diagnostics, Performance and Troubleshoot
Oracle Fuson Middleware Diagnostics, Performance and TroubleshootOracle Fuson Middleware Diagnostics, Performance and Troubleshoot
Oracle Fuson Middleware Diagnostics, Performance and TroubleshootMichel Schildmeijer
 
NodeJS Concurrency
NodeJS ConcurrencyNodeJS Concurrency
NodeJS Concurrencypgriess
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tourq3boy
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2tianyi5212222
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2http403
 

Similar a T4T Training day - NodeJS (20)

"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVM
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJS
 
Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA...
Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA...Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA...
Stealing Chromium: Embedding HTML5 with the Servo Browser Engine (LinuxCon NA...
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Be faster then rabbits
Be faster then rabbitsBe faster then rabbits
Be faster then rabbits
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
01 java intro
01 java intro01 java intro
01 java intro
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012End-to-end W3C APIs - tpac 2012
End-to-end W3C APIs - tpac 2012
 
Oracle Fuson Middleware Diagnostics, Performance and Troubleshoot
Oracle Fuson Middleware Diagnostics, Performance and TroubleshootOracle Fuson Middleware Diagnostics, Performance and Troubleshoot
Oracle Fuson Middleware Diagnostics, Performance and Troubleshoot
 
Mini-Training: Node.js
Mini-Training: Node.jsMini-Training: Node.js
Mini-Training: Node.js
 
JavaScript Event Loop
JavaScript Event LoopJavaScript Event Loop
JavaScript Event Loop
 
NodeJS Concurrency
NodeJS ConcurrencyNodeJS Concurrency
NodeJS Concurrency
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 

Último

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

T4T Training day - NodeJS

  • 2. Content • About me • Common Js • Node Js • Demo(s) ! • Grunt Js • Demo !
  • 4. About me Tim Sommer (@sommertim) >3 years @ T4T Passion for Front-End Development http://blog.timsommer.be https://github.com/timsommer
  • 5. Learning JavaScript used to mean you weren't a serious software developer. Today, not learning Javascript means the same thing. - Tim O'Reilly
  • 6.
  • 8. Server side JavaScript? • Has been around for a long time • Very fragmented: • Netscape started server-side scripting (SSJS), December, 1994 • Mozilla Spidermonkey, C, Firefox > 3.5, GNOME (started at Netscape), first engine ever, 1996 • Mozilla Rhino, Java, 1997 (started by Netscape for navigator) • Google V8, Chrome, September 2, 2008. • SquirrelFish (AKA JavaScriptCore), Webkit, June 2, 2008
  • 9. Server side problems? • No compatible standard library. • No standard interface to connect to a database. • No standard method to insert different modules. • No method for packaging code for distribution and installation. • Module storage of a common package that solves dependency is necessary.
  • 10. Commonjs ? • Kevin Dangoor, January 2009 • Spec • JavaScript ecosystem for web servers, desktop and command line apps and in the browser. • CommonJS-compliant systems: • Server-side JavaScript applications • Command line tools • Desktop GUI-based applications • Hybrid applications (Titanium, Adobe AIR)
  • 11. Why Server Side js? • Familiar and universal • Same language on server and client (code sharing) • Notions from Self, Scheme, and Prototype - all with a C/C++/Java-like syntax. • Server side JavaScript has the potential to significantly outperform other common dynamic languages.
  • 13. Common Spec? • Modules • Binary strings and buffers • Charset encodings • Binary, buffered, and textual input and output (io) streams • System process arguments, environment, and streams • File system interface • Socket streams • Unit test assertions, running, and reporting • Web server gateway interface, JSGI • Local and remote packages and package management
  • 16. AMD? • Asynchronous module definition • Started as offspin (fork) of CommonJs • Failed to reach an agreement in discussions with CommonJS about using JavaScript module in an asynchronous situation. • Evolved in own module definition API • The difference in the module specifications defined by the two territories are in module load.
  • 17. Implementations • ArangoDB (V8): NoSQL • CouchDB (SpiderMonkey): NoSQL • AkShell (V8): browser based IDE • Narwhal (V8, Rhino): JavaScript platform • Requirejs (Web Browser): module loader • Curljs (Web browser): resource loader • Whenjs (Web browser): async promises library • … • Nodejs (V8)
  • 18.
  • 20. Nodejs? • Event-driven • Flow is determined by events • Event loop • Non-blocking I/O (AKA asynchronous I/O) • I/O processing while permitting other processing to continue • Parallel I/O • You can do other things while waiting. • You can wait on more than one thing at a time. • CommonJS • V8
  • 21. What makes nodejs Fast? • Node.js is fast by design • Never blocking on I/O means less threads. • This means YOU handle scheduling.
  • 22. Node – Java runtime? Java : Node : Concurrent Requests Avg Response time (ms) Requests/second 10 23 422 50 119 416 100 243 408 150 363 411 Concurrent Requests Avg Response time (ms) Requests/second 10 19 509 50 109 453 100 196 507 150 294 506
  • 23. Node – Apache runtime? Apache (PHP)
  • 24. Node – Apache runtime? Node
  • 26. CPU intensive computations • Node -> single threaded execution model • Fibonacci function = one event tick • Blocking your node server completely • IO (DB, Filesystem) is the bottleneck, These calls are completely async
  • 28. CPU intensive computations • NPM Modules: • ‘flow’, ‘async’, ‘step’ and ‘Q’. • ‘Threads a GoGo’ natively utilizes threading inside the V8 engine (and therefore relies on a newer release of node.js) • ‘Webworkers’
  • 32. NPM • NPM (Node Package Manager) • express • async • grunt • mocha • helmet • socket.io • underscore • ……… (> 50.000)
  • 33. Demo! Building a web-app with Express
  • 34.
  • 36. Gruntjs • Task runner in Node • Automation • Minification, compilation, unit testing, linting, .. • Custom tasks! • Commonjs Compliant
  • 37. Gruntjs People will always want to do stupid things, and luckily for those people, there's JSHint -Douglas Crockford
  • 39. Q&A ?