SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Ansuman Roy
Agenda
 Introduction
 History
 Why Node.js
 Community
 Features
 FAQ
 Few Awesome Modules!
 Conclusion
get ready to node, this session is
hands on!
Introduction
 It’s NOT a web framework, and it’s also NOT a language
 Open Source, cross-platform runtime environment for
server-side and networking applications
 Based on Google V8 Engine Asynchronous i/o framework
 Core in c++ on top of v8
 Rest of it in javascript
 Swiss army knife for network Related stuffs
 Can handle thousands of Concurrent connections with
Minimal overhead (cpu/memory) on a single process
 Licence MIT
 Last release : v7.2.1
 385,151 + npm modules
History
 Initial Release May 27, 2009
 Created by Ryan Dahl
 Development && maintenance sponsored by Joyent
Is Node JS a serious option for enterprise
applications?
In fact, it’s our
best option for
typical (heavy
data IO) web
applications!
Let’s see why…
Why Node?
 Less keystrokes with JS
 JS on server and client allows
for more code reuse
 A lite stack (quick create-test
cycle)
 1 Language for Frontend and
Backend
 Large number of offerings for
web app creation
 Active community
Build Fast!
Why Node?
 Fast V8 Engine
 Single Thread with Event
Loop
 Great I/O performance
with event loop!
 Small number of layers
 Horizontal Scaling
Run Fast!
Why Node?
 JS across stack allows
easier refactoring
 Smaller codebase
 Cross platform( Windows,
Linux, Mac)
 See #1 (Build Fast!)
Adapt Fast!
“There’s a shift in enterprise IT,
unbundling the monolith software
packages [at many companies] that
Community
 Over 8 billion downloads per month
 NPM averages 461 new modules per day (ruby gems
37 per day, maven 156 per day)
 Total Number of npm Packages: 105,109
 Second most stared project on Github
 Plus, corporate backing from Joyent
Community
Reference : http://www.modulecounts.com/
Community
Running Node Apps
Hands On #1 – ‘Welcome Noder!’
Node Globals
process – object providing information and methods
for the current process
➢ process.stdout, process.stderr, process.stdin,
process.argv, process.env
 console – allows printing to stdout and stderr
 require() – function to load a module
 module – refers to the current module
Modules
 Modules allow Node to be extended (act as libaries)
 We can include a module with the global require
function, require(‘module’)
 Node provides core modules that can be included by
their name:
 File System – require(‘fs’)
 Http – require(‘http’)
 Utilities – require(‘util’)
Modules
 We can also break our application up into modules
and require them using a file path:
 ‘/’ (absolute path), ‘./’ and ‘../’ (relative to calling file)
 Any valid type can be exported from a module by
assigning it to module.exports
Modules
bar.js
module.exports = ‘I am a string’
foo.js
var msg = require(‘./bar.js’)
console.log(msg) // prints ‘I am a string’
Modules
bar.js
module.exports.hello = function() {return ‘hello’}
module.exports.bye = function() {return ‘bye’}
foo.js
var bar = require(‘./bar.js’)
console.log(bar.hello()) // prints ‘hello’
console.log(bar.bye()) // prints ‘bye’
Requiring Modules, File System, Args
Hands On #2 – ‘Require It’
Node Architecture
V8
Thread
Pool
(libeio)
Event
Loop
(libev)
Node Bindings
(socket, http, etc.)
Node Standard Library
C
C++
JavaScript
Node Architecture
 Node handles requests with a single thread (the
event loop)!
Node Architecture
 How can this be faster?
 Expensive I/O is moved off request thread (in
traditional multi-threaded environments, each thread
handles the complete request)
 Threads are limited by RAM and are expensive to create
 Avoids context switching
 Allows us to easily write asynchronous code without
heavy thread management (synchronization,
message passing, etc.)
Node Architecture
Node Architecture
Warning! Be careful to keep
CPU intensive operations off
the event loop.
Http and Streams
Hands On #3 – ‘Real Time Data Flow’
NPM
 Modules can be shared by packaging
 Node Package Manager (NPM) is a package manager
for node
 Command line interface
 Public registry www.npmjs.org
 Allows us to install packages from repo, and publish our
own
NPM
 First, we need to create a package.json file for our
app
 Contains metadata for our app and lists the
dependencies
 Package.json Interactive Guide
NPM
 Common npm commands:
 npm init initialize a package.json file
 npm install <package name> -g install a package, if –g option is
given package will be installed as a global, --save and --save-dev will add package
to your dependencies
 npm install install packages listed in package.json
 npm ls –g listed local packages (without –g) or global packages (with –g)
 npm update <package name> update a package
NPM
 SemVar Versions (version [Major].[Minor].[Patch]):
 = (default), >, <, >=, <=
 * most recent version
 1.2.3 – 2.3.4 version greater than 1.2.3 and less than 2.3.4
 ~1.2.3 most recent patch version greater than or equal to 1.2.3 (>=1.2.3 <1.3.0)
 ^1.2.3 most recent minor version greater than or equal to 1.2.3 (>=1.2.3 <2.0.0)
Http and Express
Hands On #4 – ‘Services’
FAQ
 V8 engine performs just as good, if not better than jvm
 Most ‘intensive’ code is usually due to I/O
 If needed, child processes, web workers, and so forth can be used
○ Of course! As always, be aware of language holes (like ‘eval’)
○ Node Security Project lists vulnerabilities in packages
What about CPU intensive code?
Is Node secure?
FAQ
○ Most ‘cryptic’ code is DOM related (ex. selectors)
○ Preprocessors and ECMAScript 6 bringing more strict typing (and
compile time checking)
○ As always, need standards and best practices!
What about code
readability/maintenance with JavaScript?
FAQ
○ Built-in Node debugger not great, but IDEs and other tools have the
usual debugging experience
○ V. 0.12 will improve tracing capabilities to allow better performance
monitoring, and production grade tools such as New Relic
Isn’t debugging and production
monitoring bad?
Other Awesome Modules
 skipper-gridfs – A skipper adapter to allow uploading
files to MongoDB's GridFS
 async – higher order functions and common patterns for
asynchronous code
 fs-extra– fs-extra contains methods that aren't included
in the vanilla Node.js fs package. Such as mkdir -p, cp -r,
and rm -rf
 request – Simplified HTTP request client
 mongoose – MongoDB ODM
Other Awesome Modules
 sails– API-driven framework for building realtime apps,
using MVC conventions (based on Express and Socket.io)
 express – Fast, unopinionated, minimalist web
framework
 jsreport– javascript based business reporting
 config – runtime configuration
 xls-to-json – Converting xls file to json files using nodejs
Thanks!
http://nodejs.org/
https://www.npmjs.com/
Learn More at

Weitere ähnliche Inhalte

Was ist angesagt?

Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Bastian Feder
 
Getting started with developing Nodejs
Getting started with developing NodejsGetting started with developing Nodejs
Getting started with developing NodejsPhil Hawksworth
 
Control Your Network ASICs, What Benefits switchdev Can Bring Us
Control Your Network ASICs, What Benefits switchdev Can Bring UsControl Your Network ASICs, What Benefits switchdev Can Bring Us
Control Your Network ASICs, What Benefits switchdev Can Bring UsHungWei Chiu
 
How to be a self-taught programmer best practices - Edgar Eldy
How to be a self-taught programmer  best practices - Edgar EldyHow to be a self-taught programmer  best practices - Edgar Eldy
How to be a self-taught programmer best practices - Edgar EldyGDG Bujumbura
 
Debugging of (C)Python applications
Debugging of (C)Python applicationsDebugging of (C)Python applications
Debugging of (C)Python applicationsRoman Podoliaka
 
Philly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJSPhilly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJSRoss Kukulinski
 
Docker on Mesos With OpenVNet (eng)
Docker on Mesos With OpenVNet (eng)Docker on Mesos With OpenVNet (eng)
Docker on Mesos With OpenVNet (eng)skipping classes
 
SELF 2010: BSD For Linux Users
SELF 2010: BSD For Linux UsersSELF 2010: BSD For Linux Users
SELF 2010: BSD For Linux UsersDru Lavigne
 
Anton Cherednikov "Modules and Artifacts in NPM"
Anton Cherednikov "Modules and Artifacts in NPM"Anton Cherednikov "Modules and Artifacts in NPM"
Anton Cherednikov "Modules and Artifacts in NPM"LogeekNightUkraine
 
Switchdev - No More SDK
Switchdev - No More SDKSwitchdev - No More SDK
Switchdev - No More SDKKernel TLV
 
Do it Yourself Testing
Do it Yourself TestingDo it Yourself Testing
Do it Yourself TestingEmily Stolfo
 
Go語言開發APM微服務在Kubernetes之經驗分享
Go語言開發APM微服務在Kubernetes之經驗分享Go語言開發APM微服務在Kubernetes之經驗分享
Go語言開發APM微服務在Kubernetes之經驗分享Te-Yen Liu
 
Docker - Dicas ninjas - MolaTech Talks
Docker - Dicas ninjas -  MolaTech TalksDocker - Dicas ninjas -  MolaTech Talks
Docker - Dicas ninjas - MolaTech Talksmatheuscmpm
 
Parallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-ModeParallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-ModeAkihiro Suda
 
Kernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyKernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyAnne Nicolas
 
Automate Yo'self -- SeaGL
Automate Yo'self -- SeaGL Automate Yo'self -- SeaGL
Automate Yo'self -- SeaGL John Anderson
 
[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020Akihiro Suda
 
リニア放送型動画サービスの 
Web フロントエンド
リニア放送型動画サービスの 
Web フロントエンドリニア放送型動画サービスの 
Web フロントエンド
リニア放送型動画サービスの 
Web フロントエンドYusuke Goto
 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spacesluccastera
 

Was ist angesagt? (20)

Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1
 
Getting started with developing Nodejs
Getting started with developing NodejsGetting started with developing Nodejs
Getting started with developing Nodejs
 
Control Your Network ASICs, What Benefits switchdev Can Bring Us
Control Your Network ASICs, What Benefits switchdev Can Bring UsControl Your Network ASICs, What Benefits switchdev Can Bring Us
Control Your Network ASICs, What Benefits switchdev Can Bring Us
 
How to be a self-taught programmer best practices - Edgar Eldy
How to be a self-taught programmer  best practices - Edgar EldyHow to be a self-taught programmer  best practices - Edgar Eldy
How to be a self-taught programmer best practices - Edgar Eldy
 
Debugging of (C)Python applications
Debugging of (C)Python applicationsDebugging of (C)Python applications
Debugging of (C)Python applications
 
Philly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJSPhilly Tech Week Introduction to NodeJS
Philly Tech Week Introduction to NodeJS
 
Docker on Mesos With OpenVNet (eng)
Docker on Mesos With OpenVNet (eng)Docker on Mesos With OpenVNet (eng)
Docker on Mesos With OpenVNet (eng)
 
SELF 2010: BSD For Linux Users
SELF 2010: BSD For Linux UsersSELF 2010: BSD For Linux Users
SELF 2010: BSD For Linux Users
 
Anton Cherednikov "Modules and Artifacts in NPM"
Anton Cherednikov "Modules and Artifacts in NPM"Anton Cherednikov "Modules and Artifacts in NPM"
Anton Cherednikov "Modules and Artifacts in NPM"
 
Switchdev - No More SDK
Switchdev - No More SDKSwitchdev - No More SDK
Switchdev - No More SDK
 
Do it Yourself Testing
Do it Yourself TestingDo it Yourself Testing
Do it Yourself Testing
 
Go語言開發APM微服務在Kubernetes之經驗分享
Go語言開發APM微服務在Kubernetes之經驗分享Go語言開發APM微服務在Kubernetes之經驗分享
Go語言開發APM微服務在Kubernetes之經驗分享
 
Docker - Dicas ninjas - MolaTech Talks
Docker - Dicas ninjas -  MolaTech TalksDocker - Dicas ninjas -  MolaTech Talks
Docker - Dicas ninjas - MolaTech Talks
 
Parallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-ModeParallelizing CI using Docker Swarm-Mode
Parallelizing CI using Docker Swarm-Mode
 
Kernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are moneyKernel Recipes 2019 - Metrics are money
Kernel Recipes 2019 - Metrics are money
 
App container rkt
App container rktApp container rkt
App container rkt
 
Automate Yo'self -- SeaGL
Automate Yo'self -- SeaGL Automate Yo'self -- SeaGL
Automate Yo'self -- SeaGL
 
[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020[KubeCon NA 2020] containerd: Rootless Containers 2020
[KubeCon NA 2020] containerd: Rootless Containers 2020
 
リニア放送型動画サービスの 
Web フロントエンド
リニア放送型動画サービスの 
Web フロントエンドリニア放送型動画サービスの 
Web フロントエンド
リニア放送型動画サービスの 
Web フロントエンド
 
Concurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple SpacesConcurrent Programming with Ruby and Tuple Spaces
Concurrent Programming with Ruby and Tuple Spaces
 

Andere mochten auch

Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
Design patterns through refactoring
Design patterns through refactoringDesign patterns through refactoring
Design patterns through refactoringGanesh Samarthyam
 
From Hello World to Real World - Container Days Boston 2016
From Hello World to Real World - Container Days Boston 2016From Hello World to Real World - Container Days Boston 2016
From Hello World to Real World - Container Days Boston 2016Shannon Williams
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
Angular JS blog tutorial
Angular JS blog tutorialAngular JS blog tutorial
Angular JS blog tutorialClaude Tech
 
Node.js ― Hello, world! の1歩先へ。
Node.js ― Hello, world! の1歩先へ。Node.js ― Hello, world! の1歩先へ。
Node.js ― Hello, world! の1歩先へ。Tatsuya Tobioka
 
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
 
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image AnalysisEmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysisjeresig
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework Sakthi Bro
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JSAkshay Mathur
 

Andere mochten auch (20)

Node js for beginners
Node js for beginnersNode js for beginners
Node js for beginners
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Angular js
Angular jsAngular js
Angular js
 
Angular js
Angular jsAngular js
Angular js
 
Design patterns through refactoring
Design patterns through refactoringDesign patterns through refactoring
Design patterns through refactoring
 
From Hello World to Real World - Container Days Boston 2016
From Hello World to Real World - Container Days Boston 2016From Hello World to Real World - Container Days Boston 2016
From Hello World to Real World - Container Days Boston 2016
 
Design Patterns in .Net
Design Patterns in .NetDesign Patterns in .Net
Design Patterns in .Net
 
Nodejs vatsal shah
Nodejs vatsal shahNodejs vatsal shah
Nodejs vatsal shah
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Creational Design Patterns
Creational Design PatternsCreational Design Patterns
Creational Design Patterns
 
Angular JS blog tutorial
Angular JS blog tutorialAngular JS blog tutorial
Angular JS blog tutorial
 
Node.js ― Hello, world! の1歩先へ。
Node.js ― Hello, world! の1歩先へ。Node.js ― Hello, world! の1歩先へ。
Node.js ― Hello, world! の1歩先へ。
 
Get satrted angular js
Get satrted angular jsGet satrted angular js
Get satrted angular js
 
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
 
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image AnalysisEmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
 
Angular 2
Angular 2Angular 2
Angular 2
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JS
 

Ähnlich wie Node js meetup

Introduction to NodeJS JSX is an extended Javascript based language used by R...
Introduction to NodeJS JSX is an extended Javascript based language used by R...Introduction to NodeJS JSX is an extended Javascript based language used by R...
Introduction to NodeJS JSX is an extended Javascript based language used by R...JEEVANANTHAMG6
 
Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed AssafAhmed Assaf
 
Mastering node.js, part 1 - introduction
Mastering node.js, part 1 - introductionMastering node.js, part 1 - introduction
Mastering node.js, part 1 - introductioncNguyn826690
 
Node JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsNode JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsExpeed Software
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginnersEnoch Joshua
 
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platformSreenivas Kappala
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopleffen
 
Node js Modules and Event Emitters
Node js Modules and Event EmittersNode js Modules and Event Emitters
Node js Modules and Event EmittersTheCreativedev Blog
 
An introduction to Node.js application development
An introduction to Node.js application developmentAn introduction to Node.js application development
An introduction to Node.js application developmentshelloidhq
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Ganesh Kondal
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBhargav Anadkat
 
How to Install Node.js and NPM on Windows and Mac?
How to Install Node.js and NPM on Windows and Mac?How to Install Node.js and NPM on Windows and Mac?
How to Install Node.js and NPM on Windows and Mac?Inexture Solutions
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDDSudar Muthu
 

Ähnlich wie Node js meetup (20)

Introduction to NodeJS JSX is an extended Javascript based language used by R...
Introduction to NodeJS JSX is an extended Javascript based language used by R...Introduction to NodeJS JSX is an extended Javascript based language used by R...
Introduction to NodeJS JSX is an extended Javascript based language used by R...
 
Introduction to node.js By Ahmed Assaf
Introduction to node.js  By Ahmed AssafIntroduction to node.js  By Ahmed Assaf
Introduction to node.js By Ahmed Assaf
 
Mastering node.js, part 1 - introduction
Mastering node.js, part 1 - introductionMastering node.js, part 1 - introduction
Mastering node.js, part 1 - introduction
 
Nodejs
NodejsNodejs
Nodejs
 
Node JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applicationsNode JS - A brief overview on building real-time web applications
Node JS - A brief overview on building real-time web applications
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 
Node js (runtime environment + js library) platform
Node js (runtime environment + js library) platformNode js (runtime environment + js library) platform
Node js (runtime environment + js library) platform
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
Node js Modules and Event Emitters
Node js Modules and Event EmittersNode js Modules and Event Emitters
Node js Modules and Event Emitters
 
02 Node introduction
02 Node introduction02 Node introduction
02 Node introduction
 
An introduction to Node.js application development
An introduction to Node.js application developmentAn introduction to Node.js application development
An introduction to Node.js application development
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
 
Node.js security tour
Node.js security tourNode.js security tour
Node.js security tour
 
World of Node.JS
World of Node.JSWorld of Node.JS
World of Node.JS
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
How to Install Node.js and NPM on Windows and Mac?
How to Install Node.js and NPM on Windows and Mac?How to Install Node.js and NPM on Windows and Mac?
How to Install Node.js and NPM on Windows and Mac?
 
Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
Node.js
Node.jsNode.js
Node.js
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 

Kürzlich hochgeladen

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
[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
 
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
 
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
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
[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
 
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...
 
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...
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Node js meetup

  • 2. Agenda  Introduction  History  Why Node.js  Community  Features  FAQ  Few Awesome Modules!  Conclusion get ready to node, this session is hands on!
  • 3.
  • 4. Introduction  It’s NOT a web framework, and it’s also NOT a language  Open Source, cross-platform runtime environment for server-side and networking applications  Based on Google V8 Engine Asynchronous i/o framework  Core in c++ on top of v8  Rest of it in javascript  Swiss army knife for network Related stuffs  Can handle thousands of Concurrent connections with Minimal overhead (cpu/memory) on a single process
  • 5.  Licence MIT  Last release : v7.2.1  385,151 + npm modules
  • 6. History  Initial Release May 27, 2009  Created by Ryan Dahl  Development && maintenance sponsored by Joyent
  • 7. Is Node JS a serious option for enterprise applications? In fact, it’s our best option for typical (heavy data IO) web applications! Let’s see why…
  • 8. Why Node?  Less keystrokes with JS  JS on server and client allows for more code reuse  A lite stack (quick create-test cycle)  1 Language for Frontend and Backend  Large number of offerings for web app creation  Active community Build Fast!
  • 9. Why Node?  Fast V8 Engine  Single Thread with Event Loop  Great I/O performance with event loop!  Small number of layers  Horizontal Scaling Run Fast!
  • 10. Why Node?  JS across stack allows easier refactoring  Smaller codebase  Cross platform( Windows, Linux, Mac)  See #1 (Build Fast!) Adapt Fast! “There’s a shift in enterprise IT, unbundling the monolith software packages [at many companies] that
  • 11. Community  Over 8 billion downloads per month  NPM averages 461 new modules per day (ruby gems 37 per day, maven 156 per day)  Total Number of npm Packages: 105,109  Second most stared project on Github  Plus, corporate backing from Joyent
  • 14. Running Node Apps Hands On #1 – ‘Welcome Noder!’
  • 15. Node Globals process – object providing information and methods for the current process ➢ process.stdout, process.stderr, process.stdin, process.argv, process.env  console – allows printing to stdout and stderr  require() – function to load a module  module – refers to the current module
  • 16. Modules  Modules allow Node to be extended (act as libaries)  We can include a module with the global require function, require(‘module’)  Node provides core modules that can be included by their name:  File System – require(‘fs’)  Http – require(‘http’)  Utilities – require(‘util’)
  • 17. Modules  We can also break our application up into modules and require them using a file path:  ‘/’ (absolute path), ‘./’ and ‘../’ (relative to calling file)  Any valid type can be exported from a module by assigning it to module.exports
  • 18. Modules bar.js module.exports = ‘I am a string’ foo.js var msg = require(‘./bar.js’) console.log(msg) // prints ‘I am a string’
  • 19. Modules bar.js module.exports.hello = function() {return ‘hello’} module.exports.bye = function() {return ‘bye’} foo.js var bar = require(‘./bar.js’) console.log(bar.hello()) // prints ‘hello’ console.log(bar.bye()) // prints ‘bye’
  • 20. Requiring Modules, File System, Args Hands On #2 – ‘Require It’
  • 22. Node Architecture  Node handles requests with a single thread (the event loop)!
  • 23. Node Architecture  How can this be faster?  Expensive I/O is moved off request thread (in traditional multi-threaded environments, each thread handles the complete request)  Threads are limited by RAM and are expensive to create  Avoids context switching  Allows us to easily write asynchronous code without heavy thread management (synchronization, message passing, etc.)
  • 25. Node Architecture Warning! Be careful to keep CPU intensive operations off the event loop.
  • 26. Http and Streams Hands On #3 – ‘Real Time Data Flow’
  • 27. NPM  Modules can be shared by packaging  Node Package Manager (NPM) is a package manager for node  Command line interface  Public registry www.npmjs.org  Allows us to install packages from repo, and publish our own
  • 28. NPM  First, we need to create a package.json file for our app  Contains metadata for our app and lists the dependencies  Package.json Interactive Guide
  • 29. NPM  Common npm commands:  npm init initialize a package.json file  npm install <package name> -g install a package, if –g option is given package will be installed as a global, --save and --save-dev will add package to your dependencies  npm install install packages listed in package.json  npm ls –g listed local packages (without –g) or global packages (with –g)  npm update <package name> update a package
  • 30. NPM  SemVar Versions (version [Major].[Minor].[Patch]):  = (default), >, <, >=, <=  * most recent version  1.2.3 – 2.3.4 version greater than 1.2.3 and less than 2.3.4  ~1.2.3 most recent patch version greater than or equal to 1.2.3 (>=1.2.3 <1.3.0)  ^1.2.3 most recent minor version greater than or equal to 1.2.3 (>=1.2.3 <2.0.0)
  • 31. Http and Express Hands On #4 – ‘Services’
  • 32. FAQ  V8 engine performs just as good, if not better than jvm  Most ‘intensive’ code is usually due to I/O  If needed, child processes, web workers, and so forth can be used ○ Of course! As always, be aware of language holes (like ‘eval’) ○ Node Security Project lists vulnerabilities in packages What about CPU intensive code? Is Node secure?
  • 33. FAQ ○ Most ‘cryptic’ code is DOM related (ex. selectors) ○ Preprocessors and ECMAScript 6 bringing more strict typing (and compile time checking) ○ As always, need standards and best practices! What about code readability/maintenance with JavaScript?
  • 34. FAQ ○ Built-in Node debugger not great, but IDEs and other tools have the usual debugging experience ○ V. 0.12 will improve tracing capabilities to allow better performance monitoring, and production grade tools such as New Relic Isn’t debugging and production monitoring bad?
  • 35. Other Awesome Modules  skipper-gridfs – A skipper adapter to allow uploading files to MongoDB's GridFS  async – higher order functions and common patterns for asynchronous code  fs-extra– fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf  request – Simplified HTTP request client  mongoose – MongoDB ODM
  • 36. Other Awesome Modules  sails– API-driven framework for building realtime apps, using MVC conventions (based on Express and Socket.io)  express – Fast, unopinionated, minimalist web framework  jsreport– javascript based business reporting  config – runtime configuration  xls-to-json – Converting xls file to json files using nodejs

Hinweis der Redaktion

  1. Node is open source with MIC license under Joyent
  2. Node is an Asynchronous i/o framework; Not just another web framework
  3. Ryan inspired to show progress of a file upload; So that’s why Node get invented. Wow!
  4. Even with less no of developers than in java we can build fast in Node js
  5. Ryan inspired to show progress of a file upload
  6. Ryan inspired to show progress of a file upload
  7. Can install modules using the command npm install module
  8. Mention exports alias (variable)
  9. Creates threads only when needed (for IO) Mention options for mutli-threading (cluster) process.nextTick()
  10. Ruby on rails to node Linkedin claims:  Node.js being up to 20x faster than Rails for certain scenarios
  11. Options for moving operations off (child process, web workers)
  12. Mention features also coming in v 0.12