SlideShare a Scribd company logo
JACOB NELSON
SOFTWARE ARCHITECT
Node.js is not a silver-bullet new platform that will
dominate the web development world. Instead,
it’s a platform that fills a particular need.
A word of warning
There are some really excellent JavaScript people out
there. I'm not one of them.
Node JS is a powerful tool for controlling web
servers, building applications, and creating event-
driven programming and it brings JavaScript, a
language familiar to all web developers, into an
environment independent of web browsers.
Node.js® is a JavaScript runtime built
on Chrome'sV8 JavaScript engine.
Runtime is when a program is
running (or being executable).That is,
when you start a program running in
a computer, it is runtime for that
program.
Node.js is not a JavaScript framework
Node.js allows you to run JavaScript
code in the backend, outside a
browser.
+
Node.js ships with a lot of useful
modules, so you don't have to write
everything from scratch
Thus, Node.js is really two things:
a runtime environment and a library.
Requirements
▪ JavaScript
▪ Command-LineTool
V8
TheV8 JavaScript Engine is an open source JavaScript
engine developed byThe Chromium Project for the
Google Chrome web browser. It has seen used in
many other projects, such as Couchbase, MongoDB
and Node.js.
https://en.wikipedia.org/wiki/V8_(JavaScript_engine)
Threading
Node is single-threaded and uses a concurrency
model based on an event loop. It is non-blocking, so it
doesn't make the program wait, but instead it
registers a callback and lets the program continue.
This means it can handle concurrent operations
without multiple threads of execution, so it can scale
pretty well.
Installing Node
If you're using OS X orWindows, the best way to
install Node.js is to use one of the installers from the
Node.js download page.
If you're using Linux, you can use the installer, or you
can check Node Source's binary distributions to see
whether or not there's a more recent version that
works with your system.
Test
node -v
npm, the official Node package manager
npm is the package manager for JavaScript.
npm makes it easy for JavaScript developers to share
and reuse code, and it makes it easy to update the
code that you're sharing.
npm, the official Node package manager
Node comes with npm installed so you should have a
version of npm. However, npm gets updated more
frequently than Node does, so you'll want to make
sure it's the latest version.
npm, the official Node package manager
▪ It installs application dependencies locally, not globally.
▪ It handles multiple versions of the same module at the
same time.
▪ You can specify tarballs or git repositories as
dependencies.
▪ It's really easy to publish your own module to the npm
registry.
▪ It's useful for creating CLI utilities that others can install
(with npm) and use right away.
Npm behind firewall
npm config set proxy http://gateway.zscaler.net:9400
npm config set https-proxy
http://gateway.zscaler.net:9400
Updating npm
npm install npm@latest -g
Test
npm -v
Your First Program
console.log('HelloWorld');
npm init
The npm init command is a step-by-step tool to scaffold
out your project. It will prompt you for input for a few
aspects of the project in the following order:
npm init
▪ The project's name
▪ The project's initial version
▪ The project's description
▪ The project's entry point (meaning the project's main file)
▪ The project's test command (to trigger testing with something like Standard)
▪ The project's git repository (where the project source can be found)
▪ The project's keywords (basically, tags related to the project)
▪ The project's license (this defaults to ISC - most open-source Node.js projects are
MIT)
npm init
Once you run through the npm init steps above, a
package.json file will be generated and placed in the
current directory. If you run it in a directory that's not
exclusively for your project, don't worry! Generating a
package.json doesn't really do anything, other than create
a package.json file.You can either move the package.json
file to a directory that's dedicated to your project, or you
can create an entirely new one in such a directory.
npm init
Once you run through the npm init steps above, a
package.json file will be generated and placed in the
current directory. If you run it in a directory that's not
exclusively for your project, don't worry! Generating a
package.json doesn't really do anything, other than create
a package.json file.You can either move the package.json
file to a directory that's dedicated to your project, or you
can create an entirely new one in such a directory.
npm init options
If you invoke it with -f, --force, -y, or --yes, it will use only
defaults and not prompt you for any options.
package.json
package.json file can be described as a manifest of your
project that includes the packages and applications it
depends on, information about its unique source control,
and specific metadata like the project's name, description,
and author.
package.json
package.json
package.json also contains a collection of any given project's
dependencies.These dependencies are the modules that the project
relies on to function properly.
package.json - dependencies
Dependencies are specified in a simple object that maps a package
name to a version range.The version range is a string which has one or
more space-separated descriptors.
Having dependencies in your project's package.json allows the project
to install the versions of the modules it depends on. By running an
install command inside of a project, you can install all of the
dependencies that are listed in the project's package.json - meaning
they don't have to be (and almost never should be) bundled with the
project itself.
package.json - devDependencies
It also allows the separation of dependencies that are needed for
production and dependencies that are needed for development. In
production, you're likely not going to need a tool to watch yourCSS
files for changes and refresh the app when they change.
package.json – module version
▪ version Must match version exactly
▪ >version Must be greater than version
▪ >=version etc
▪ <version
▪ <=version~version "Approximately equivalent to version"
▪ ^version "Compatible with version"
▪ 1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
package.json – module version
▪ http://...
▪ * Matches any version
▪ "" (just an empty string) Same as *
▪ version1 - version2 Same as >=version1 <=version2.
▪ range1 || range2 Passes if either range1 or range2 are satisfied.
▪ git...
▪ user/repo See 'GitHub URLs' below
▪ tagA specific version tagged and published as tag
▪ path/path/path
Modules - Installation
npm install <-g> module name
Modules – Installation
npm install
Once you run this, npm will begin the installation process of all of the
current project's dependencies.
Modules – Installation Options
npm install <module> --save
when installing a module: --save, it will install and save it as an entry in
the dependencies
npm install <module> --save-dev
when installing a module: --save-dev, it will install and save it as an
entry in the devDependencies
Modules – Listing
Sometimes is useful to see the list of packages that you have installed
on your system.You can do that with the following commands:
# list all installed modules with dependencies
npm ls
# list all installed modules without dependencies
npm ls --depth=0
# list all installed globally dependencies
npm ls -g --depth=0
Extraneous Modules
Modules which are installed and are found on node_modules folder, but
not included as Dependency or devDependency in package.json
Module – uninstallation
# uninstall package and leave it listed as dep
npm uninstall <package_name>
# uninstall and remove from dependencies
npm uninstall --save <package_name>
# uninstall global package
npm uninstall -g <package_name>
# remove uninstalled packages from node_modules
npm prune
Modules – view all versions of an NPM
Package
The easy way to view all released versions of an npm package is to use
the following command
npm show <module>@* version
Modules - Importing
▪ Java or Python use the import function to load other libraries,
▪ PHP and Ruby use require.
▪ In Node you can load other dependencies using the require keyword.
Modules - Importing
▪ For example, we can require some core modules:
▪ var http = require('http');
▪ var dns = require('dns');
Modules - Importing
What node.js will do in this case, is to first look if there is a core module
named http, and since that's the case, return that directly. But what
about non-core modules, such as 'mysql'?
In this case node.js will walk up the directory tree, moving through each
parent directory in turn, checking in each to see if there is a folder
called 'node_modules'. If such a folder is found, node.js will look into
this folder for a file called 'mysql.js'. If no matching file is found and the
directory root '/' is reached, node.js will give up and throw an exception.
Modules - Importing
▪ We can also require relative files:
▪ var myFile = require('./myFile'); // loads myFile.js
callbacks
In asynchronous programming we do not return values when our
functions are done, but instead we use the continuation-passing style
(CPS).
With this style, an asynchronous function invokes a callback (a function
usually passed as the last argument) to continue the program once the
it has finished.
When Not to Use?
▪ CPU heavy apps
▪ Simple CRUD / HTML apps
▪ NoSQL + Node.js
When to Use?
▪ JSON APIs
▪ Single page apps
▪ Streaming Data
▪ Soft Real time Applications
▪ https://www.guru99.com/node-js-tutorial.html
▪ http://www.tutorialsteacher.com/nodejs/nodejs-basics
▪ https://www.javatpoint.com/what-is-nodejs
▪ http://adrianmejia.com/blog/2016/08/19/Node-Package-Manager-NPM-
Tutorial/
▪ https://nodesource.com/blog/an-absolute-beginners-guide-to-using-npm/
▪ Best Practices
▪ https://www.codementor.io/mattgoldspink/nodejs-best-practices-
du1086jja

More Related Content

What's hot

Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
Amit Thakkar
 
Express js
Express jsExpress js
Express js
Manav Prasad
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
Marcus Frödin
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
Akshay Mathur
 
Node.js
Node.jsNode.js
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
jguerrero999
 
Building servers with Node.js
Building servers with Node.jsBuilding servers with Node.js
Building servers with Node.jsConFoo
 
Communication in Node.js
Communication in Node.jsCommunication in Node.js
Communication in Node.js
Edureka!
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialTom Croucher
 
Introduction to Node.JS Express
Introduction to Node.JS ExpressIntroduction to Node.JS Express
Introduction to Node.JS Express
Eueung Mulyana
 
NodeJS
NodeJSNodeJS
NodeJS
LinkMe Srl
 
An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications
Rohan Chandane
 
Nodejs Event Driven Concurrency for Web Applications
Nodejs Event Driven Concurrency for Web ApplicationsNodejs Event Driven Concurrency for Web Applications
Nodejs Event Driven Concurrency for Web Applications
Ganesh Iyer
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
Gabriele Lana
 
Expressjs
ExpressjsExpressjs
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
Apaichon Punopas
 
Nodejs vatsal shah
Nodejs vatsal shahNodejs vatsal shah
Nodejs vatsal shah
Vatsal N Shah
 
NodeJS: an Introduction
NodeJS: an IntroductionNodeJS: an Introduction
NodeJS: an Introduction
Roberto Casadei
 
Node.js Explained
Node.js ExplainedNode.js Explained
Node.js Explained
Jeff Kunkle
 

What's hot (20)

Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
 
Express js
Express jsExpress js
Express js
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Node.js
Node.jsNode.js
Node.js
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
 
Building servers with Node.js
Building servers with Node.jsBuilding servers with Node.js
Building servers with Node.js
 
Communication in Node.js
Communication in Node.jsCommunication in Node.js
Communication in Node.js
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
Introduction to Node.JS Express
Introduction to Node.JS ExpressIntroduction to Node.JS Express
Introduction to Node.JS Express
 
Node ppt
Node pptNode ppt
Node ppt
 
NodeJS
NodeJSNodeJS
NodeJS
 
An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications
 
Nodejs Event Driven Concurrency for Web Applications
Nodejs Event Driven Concurrency for Web ApplicationsNodejs Event Driven Concurrency for Web Applications
Nodejs Event Driven Concurrency for Web Applications
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
 
Expressjs
ExpressjsExpressjs
Expressjs
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Nodejs vatsal shah
Nodejs vatsal shahNodejs vatsal shah
Nodejs vatsal shah
 
NodeJS: an Introduction
NodeJS: an IntroductionNodeJS: an Introduction
NodeJS: an Introduction
 
Node.js Explained
Node.js ExplainedNode.js Explained
Node.js Explained
 

Similar to Overview of Node JS

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
Expeed Software
 
Mastering node.js, part 1 - introduction
Mastering node.js, part 1 - introductionMastering node.js, part 1 - introduction
Mastering node.js, part 1 - introduction
cNguyn826690
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)
iFour Technolab Pvt. Ltd.
 
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
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
Chris Cowan
 
S&T What I know about Node 110817
S&T What I know about Node 110817S&T What I know about Node 110817
S&T What I know about Node 110817
Dan Dineen
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
Bhargav Anadkat
 
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
Sreenivas Kappala
 
React Django Presentation
React Django PresentationReact Django Presentation
React Django Presentation
Allison DiNapoli
 
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
Ahmed Assaf
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
Michael Lange
 
Node JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web AppNode JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web App
Edureka!
 
3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't
F5 Buddy
 
Node js meetup
Node js meetupNode js meetup
Node js meetup
Ansuman Roy
 
Understanding NuGet implementation for Enterprises
Understanding NuGet implementation for EnterprisesUnderstanding NuGet implementation for Enterprises
Understanding NuGet implementation for Enterprises
J S Jodha
 
Node js Global Packages
Node js Global PackagesNode js Global Packages
Node js Global Packages
sanskriti agarwal
 
Node js crash course session 1
Node js crash course   session 1Node js crash course   session 1
Node js crash course session 1
Abdul Rahman Masri Attal
 
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
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
Fabio Fumarola
 
Modern web technologies
Modern web technologiesModern web technologies
Modern web technologies
Simeon Prusiyski
 

Similar to Overview of Node JS (20)

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
 
Mastering node.js, part 1 - introduction
Mastering node.js, part 1 - introductionMastering node.js, part 1 - introduction
Mastering node.js, part 1 - introduction
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)
 
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...
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
S&T What I know about Node 110817
S&T What I know about Node 110817S&T What I know about Node 110817
S&T What I know about Node 110817
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
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
 
React Django Presentation
React Django PresentationReact Django Presentation
React Django Presentation
 
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
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
 
Node JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web AppNode JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web App
 
3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't
 
Node js meetup
Node js meetupNode js meetup
Node js meetup
 
Understanding NuGet implementation for Enterprises
Understanding NuGet implementation for EnterprisesUnderstanding NuGet implementation for Enterprises
Understanding NuGet implementation for Enterprises
 
Node js Global Packages
Node js Global PackagesNode js Global Packages
Node js Global Packages
 
Node js crash course session 1
Node js crash course   session 1Node js crash course   session 1
Node js crash course session 1
 
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?
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
Modern web technologies
Modern web technologiesModern web technologies
Modern web technologies
 

Recently uploaded

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

Overview of Node JS

  • 2. Node.js is not a silver-bullet new platform that will dominate the web development world. Instead, it’s a platform that fills a particular need.
  • 3. A word of warning There are some really excellent JavaScript people out there. I'm not one of them.
  • 4. Node JS is a powerful tool for controlling web servers, building applications, and creating event- driven programming and it brings JavaScript, a language familiar to all web developers, into an environment independent of web browsers.
  • 5. Node.js® is a JavaScript runtime built on Chrome'sV8 JavaScript engine.
  • 6. Runtime is when a program is running (or being executable).That is, when you start a program running in a computer, it is runtime for that program.
  • 7. Node.js is not a JavaScript framework
  • 8. Node.js allows you to run JavaScript code in the backend, outside a browser.
  • 9. +
  • 10. Node.js ships with a lot of useful modules, so you don't have to write everything from scratch
  • 11. Thus, Node.js is really two things: a runtime environment and a library.
  • 13. V8 TheV8 JavaScript Engine is an open source JavaScript engine developed byThe Chromium Project for the Google Chrome web browser. It has seen used in many other projects, such as Couchbase, MongoDB and Node.js. https://en.wikipedia.org/wiki/V8_(JavaScript_engine)
  • 14. Threading Node is single-threaded and uses a concurrency model based on an event loop. It is non-blocking, so it doesn't make the program wait, but instead it registers a callback and lets the program continue. This means it can handle concurrent operations without multiple threads of execution, so it can scale pretty well.
  • 15. Installing Node If you're using OS X orWindows, the best way to install Node.js is to use one of the installers from the Node.js download page. If you're using Linux, you can use the installer, or you can check Node Source's binary distributions to see whether or not there's a more recent version that works with your system.
  • 17. npm, the official Node package manager npm is the package manager for JavaScript. npm makes it easy for JavaScript developers to share and reuse code, and it makes it easy to update the code that you're sharing.
  • 18. npm, the official Node package manager Node comes with npm installed so you should have a version of npm. However, npm gets updated more frequently than Node does, so you'll want to make sure it's the latest version.
  • 19. npm, the official Node package manager ▪ It installs application dependencies locally, not globally. ▪ It handles multiple versions of the same module at the same time. ▪ You can specify tarballs or git repositories as dependencies. ▪ It's really easy to publish your own module to the npm registry. ▪ It's useful for creating CLI utilities that others can install (with npm) and use right away.
  • 20. Npm behind firewall npm config set proxy http://gateway.zscaler.net:9400 npm config set https-proxy http://gateway.zscaler.net:9400
  • 21. Updating npm npm install npm@latest -g
  • 24. npm init The npm init command is a step-by-step tool to scaffold out your project. It will prompt you for input for a few aspects of the project in the following order:
  • 25. npm init ▪ The project's name ▪ The project's initial version ▪ The project's description ▪ The project's entry point (meaning the project's main file) ▪ The project's test command (to trigger testing with something like Standard) ▪ The project's git repository (where the project source can be found) ▪ The project's keywords (basically, tags related to the project) ▪ The project's license (this defaults to ISC - most open-source Node.js projects are MIT)
  • 26. npm init Once you run through the npm init steps above, a package.json file will be generated and placed in the current directory. If you run it in a directory that's not exclusively for your project, don't worry! Generating a package.json doesn't really do anything, other than create a package.json file.You can either move the package.json file to a directory that's dedicated to your project, or you can create an entirely new one in such a directory.
  • 27. npm init Once you run through the npm init steps above, a package.json file will be generated and placed in the current directory. If you run it in a directory that's not exclusively for your project, don't worry! Generating a package.json doesn't really do anything, other than create a package.json file.You can either move the package.json file to a directory that's dedicated to your project, or you can create an entirely new one in such a directory.
  • 28. npm init options If you invoke it with -f, --force, -y, or --yes, it will use only defaults and not prompt you for any options.
  • 29. package.json package.json file can be described as a manifest of your project that includes the packages and applications it depends on, information about its unique source control, and specific metadata like the project's name, description, and author.
  • 31. package.json package.json also contains a collection of any given project's dependencies.These dependencies are the modules that the project relies on to function properly.
  • 32. package.json - dependencies Dependencies are specified in a simple object that maps a package name to a version range.The version range is a string which has one or more space-separated descriptors. Having dependencies in your project's package.json allows the project to install the versions of the modules it depends on. By running an install command inside of a project, you can install all of the dependencies that are listed in the project's package.json - meaning they don't have to be (and almost never should be) bundled with the project itself.
  • 33. package.json - devDependencies It also allows the separation of dependencies that are needed for production and dependencies that are needed for development. In production, you're likely not going to need a tool to watch yourCSS files for changes and refresh the app when they change.
  • 34. package.json – module version ▪ version Must match version exactly ▪ >version Must be greater than version ▪ >=version etc ▪ <version ▪ <=version~version "Approximately equivalent to version" ▪ ^version "Compatible with version" ▪ 1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
  • 35. package.json – module version ▪ http://... ▪ * Matches any version ▪ "" (just an empty string) Same as * ▪ version1 - version2 Same as >=version1 <=version2. ▪ range1 || range2 Passes if either range1 or range2 are satisfied. ▪ git... ▪ user/repo See 'GitHub URLs' below ▪ tagA specific version tagged and published as tag ▪ path/path/path
  • 36. Modules - Installation npm install <-g> module name
  • 37. Modules – Installation npm install Once you run this, npm will begin the installation process of all of the current project's dependencies.
  • 38. Modules – Installation Options npm install <module> --save when installing a module: --save, it will install and save it as an entry in the dependencies npm install <module> --save-dev when installing a module: --save-dev, it will install and save it as an entry in the devDependencies
  • 39. Modules – Listing Sometimes is useful to see the list of packages that you have installed on your system.You can do that with the following commands: # list all installed modules with dependencies npm ls # list all installed modules without dependencies npm ls --depth=0 # list all installed globally dependencies npm ls -g --depth=0
  • 40. Extraneous Modules Modules which are installed and are found on node_modules folder, but not included as Dependency or devDependency in package.json
  • 41. Module – uninstallation # uninstall package and leave it listed as dep npm uninstall <package_name> # uninstall and remove from dependencies npm uninstall --save <package_name> # uninstall global package npm uninstall -g <package_name> # remove uninstalled packages from node_modules npm prune
  • 42. Modules – view all versions of an NPM Package The easy way to view all released versions of an npm package is to use the following command npm show <module>@* version
  • 43. Modules - Importing ▪ Java or Python use the import function to load other libraries, ▪ PHP and Ruby use require. ▪ In Node you can load other dependencies using the require keyword.
  • 44. Modules - Importing ▪ For example, we can require some core modules: ▪ var http = require('http'); ▪ var dns = require('dns');
  • 45. Modules - Importing What node.js will do in this case, is to first look if there is a core module named http, and since that's the case, return that directly. But what about non-core modules, such as 'mysql'? In this case node.js will walk up the directory tree, moving through each parent directory in turn, checking in each to see if there is a folder called 'node_modules'. If such a folder is found, node.js will look into this folder for a file called 'mysql.js'. If no matching file is found and the directory root '/' is reached, node.js will give up and throw an exception.
  • 46. Modules - Importing ▪ We can also require relative files: ▪ var myFile = require('./myFile'); // loads myFile.js
  • 47. callbacks In asynchronous programming we do not return values when our functions are done, but instead we use the continuation-passing style (CPS). With this style, an asynchronous function invokes a callback (a function usually passed as the last argument) to continue the program once the it has finished.
  • 48. When Not to Use? ▪ CPU heavy apps ▪ Simple CRUD / HTML apps ▪ NoSQL + Node.js
  • 49. When to Use? ▪ JSON APIs ▪ Single page apps ▪ Streaming Data ▪ Soft Real time Applications
  • 50. ▪ https://www.guru99.com/node-js-tutorial.html ▪ http://www.tutorialsteacher.com/nodejs/nodejs-basics ▪ https://www.javatpoint.com/what-is-nodejs ▪ http://adrianmejia.com/blog/2016/08/19/Node-Package-Manager-NPM- Tutorial/ ▪ https://nodesource.com/blog/an-absolute-beginners-guide-to-using-npm/ ▪ Best Practices ▪ https://www.codementor.io/mattgoldspink/nodejs-best-practices- du1086jja