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.js
ConFoo
 
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 Tutorial
Tom Croucher
 
Introduction to Node.JS Express
Introduction to Node.JS ExpressIntroduction to Node.JS Express
Introduction to Node.JS Express
Eueung Mulyana
 
Node ppt
Node pptNode ppt
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

Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 

Recently uploaded (20)

Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 

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