SlideShare a Scribd company logo
Session II
©Techforce Infotech Pvt Ltd 2017-18
Environment Setup
 Text Editor
 Latest Browser
 Basic Knowledge of Command Prompt
Prerequisite
Environment Setup
 Go to the Node.js official website https://nodejs.org/en/
Environment Setup
 Run downloaded .msi file
Environment Setup
 Set nodejs path in environment variable.
Environment Setup
 Now open CMD and type “npm –v” or “node -v”
Sample Application
 Print ‘Hello World!’ using Node.js .
Console.log(‘Hello World!’);
app.js
Output- Hello World!
 Module :- Module in Node.js is a simple or complex functionality
organized in single or multiple JavaScript files which can be
reused throughout the Node.js application.
 Each module in Node.js has its own context, so it cannot
interfere with other modules or pollute global scope. Also, each
module can be placed in a separate .js file under a separate
folder.
Modules in Node.js
Types of Modules
 Core Modules : - These core modules are compiled into its binary
distribution and load automatically when Node.js process starts. Core
modules is predefined.
 http : - http module includes classes, methods and events to create Node.js
http server.
 url :- url module includes methods for URL resolution and parsing.
 querystring :- querystring module includes methods to deal with query string.
 path :- path module includes methods to deal with file paths.
 fs :- fs module includes classes, methods, and events to work with file I/O.
 util :-util module includes utility functions useful for programmers.
 Loading Core Modules :- In order to use Node.js core or NPM modules, you first
need to import it using require() function as shown below.
var module = require(“module_name”);
Types of Modules
 Local Modules : - Local modules are modules created locally in your
Node.js application.
 These modules include different functionalities of your application in separate
files and folders. You can also package it and distribute it via NPM
 This module is user defined.
log.js =====>
var log = {
info: function (info) {
console.log ('Info: ' +
info);
},
};
module.exports = log
Note: - module.exports -> whatever you assign to module.exports or exports, will
be exposed as a module.
 NPM :- Node Package Manager (NPM) is a command line
tool that installs, updates or uninstalls Node.js packages
in your application. It is also an online repository for open-
source Node.js packages. The node community around the
world creates useful modules and publishes them as
packages in this repository.
 Install Package locally - > npm install <package_name>
 Install Package globally - > npm install <package_name> -
g
 Update Package - > npm update <package_name>
 Uninstall Package - > npm uninstall <package_name>
Node Package Manager (NPM)
Session II
completed
Thank You
Session II
completed
Address: 403, Venus Benecia, Bodakdev,Ahmedabad –
380053
Reach us : reach@techforceinfotech.com
Contact no: +91 (79) 48904529

More Related Content

PPTX
Node Session - 4
ODP
Node js presentation
PDF
Webpack101
PPT
Nodejs quick start
PDF
An Introduction to node.js
PPTX
NodeJs Session02
PDF
Rails入门培训
PDF
How to setup and connect my sql to ec2 instance from ubuntu
Node Session - 4
Node js presentation
Webpack101
Nodejs quick start
An Introduction to node.js
NodeJs Session02
Rails入门培训
How to setup and connect my sql to ec2 instance from ubuntu

What's hot (20)

PPTX
NodeJs Session03
PPTX
Nodejs Session01
TXT
Msi list
PDF
PLNOG16: Automatyzacja tworzenia sieci w środowisku Vmware, Maciej Lelusz
PDF
Meteor Meets Mallory
DOCX
Solaris mysql sop
PDF
virtualization course content
PPTX
Redis fundamental
PPTX
Codemash - Building Custom node.js Modules
PDF
Node js实践
KEY
An Introduction to Node.js Development with Windows Azure
PDF
Open wrt seminar
PDF
Cookies in Angular | Install CookiesService
ODP
MySQL and SSD
PPTX
Dprn3 u3 a1_ocov
PPTX
3. hd insight on windows azure
PPTX
PDF
ASP.NET-Web Programming - Sessions and Cookies
PDF
Node.js Introduction
ODP
Sql installation
NodeJs Session03
Nodejs Session01
Msi list
PLNOG16: Automatyzacja tworzenia sieci w środowisku Vmware, Maciej Lelusz
Meteor Meets Mallory
Solaris mysql sop
virtualization course content
Redis fundamental
Codemash - Building Custom node.js Modules
Node js实践
An Introduction to Node.js Development with Windows Azure
Open wrt seminar
Cookies in Angular | Install CookiesService
MySQL and SSD
Dprn3 u3 a1_ocov
3. hd insight on windows azure
ASP.NET-Web Programming - Sessions and Cookies
Node.js Introduction
Sql installation
Ad

Similar to Node Session - 2 (20)

PDF
NodeJs Modules1.pdf
PPTX
JavaScript Module Loaders
PPTX
Mastering node.js, part 1 - introduction
PPTX
Introduction to NodeJS JSX is an extended Javascript based language used by R...
PDF
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
PPTX
node.js.pptx
PPTX
Overview of Node JS
PDF
Fundamental of Node.JS - Internship Presentation - Week7
DOCX
unit 2 of Full stack web development subject
PDF
NodeJS: an Introduction
PPTX
Linux Kernel Programming
PDF
Node JS - A brief overview on building real-time web applications
PDF
UNIT-3.pdf, buffer module, treams,file accessing using node js
PDF
Node.js essentials
PDF
mfvlkdfjvnfdiuibvdbvhfvbvcbbhdbbdjhbdgcf
PDF
Introduction To Linux Kernel Modules
PPTX
Lecture 7-Working Nodejs Packagempresenration.pptx
PPT
Kernel module programming
PPTX
Intro to Node.js (v1)
NodeJs Modules1.pdf
JavaScript Module Loaders
Mastering node.js, part 1 - introduction
Introduction to NodeJS JSX is an extended Javascript based language used by R...
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDK
node.js.pptx
Overview of Node JS
Fundamental of Node.JS - Internship Presentation - Week7
unit 2 of Full stack web development subject
NodeJS: an Introduction
Linux Kernel Programming
Node JS - A brief overview on building real-time web applications
UNIT-3.pdf, buffer module, treams,file accessing using node js
Node.js essentials
mfvlkdfjvnfdiuibvdbvhfvbvcbbhdbbdjhbdgcf
Introduction To Linux Kernel Modules
Lecture 7-Working Nodejs Packagempresenration.pptx
Kernel module programming
Intro to Node.js (v1)
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Big Data Technologies - Introduction.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Electronic commerce courselecture one. Pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Encapsulation theory and applications.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Unlocking AI with Model Context Protocol (MCP)
Big Data Technologies - Introduction.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Electronic commerce courselecture one. Pdf
Spectral efficient network and resource selection model in 5G networks
NewMind AI Weekly Chronicles - August'25 Week I
Digital-Transformation-Roadmap-for-Companies.pptx
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Review of recent advances in non-invasive hemoglobin estimation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Node Session - 2

  • 2. Environment Setup  Text Editor  Latest Browser  Basic Knowledge of Command Prompt Prerequisite
  • 3. Environment Setup  Go to the Node.js official website https://nodejs.org/en/
  • 4. Environment Setup  Run downloaded .msi file
  • 5. Environment Setup  Set nodejs path in environment variable.
  • 6. Environment Setup  Now open CMD and type “npm –v” or “node -v”
  • 7. Sample Application  Print ‘Hello World!’ using Node.js . Console.log(‘Hello World!’); app.js Output- Hello World!
  • 8.  Module :- Module in Node.js is a simple or complex functionality organized in single or multiple JavaScript files which can be reused throughout the Node.js application.  Each module in Node.js has its own context, so it cannot interfere with other modules or pollute global scope. Also, each module can be placed in a separate .js file under a separate folder. Modules in Node.js
  • 9. Types of Modules  Core Modules : - These core modules are compiled into its binary distribution and load automatically when Node.js process starts. Core modules is predefined.  http : - http module includes classes, methods and events to create Node.js http server.  url :- url module includes methods for URL resolution and parsing.  querystring :- querystring module includes methods to deal with query string.  path :- path module includes methods to deal with file paths.  fs :- fs module includes classes, methods, and events to work with file I/O.  util :-util module includes utility functions useful for programmers.  Loading Core Modules :- In order to use Node.js core or NPM modules, you first need to import it using require() function as shown below. var module = require(“module_name”);
  • 10. Types of Modules  Local Modules : - Local modules are modules created locally in your Node.js application.  These modules include different functionalities of your application in separate files and folders. You can also package it and distribute it via NPM  This module is user defined. log.js =====> var log = { info: function (info) { console.log ('Info: ' + info); }, }; module.exports = log Note: - module.exports -> whatever you assign to module.exports or exports, will be exposed as a module.
  • 11.  NPM :- Node Package Manager (NPM) is a command line tool that installs, updates or uninstalls Node.js packages in your application. It is also an online repository for open- source Node.js packages. The node community around the world creates useful modules and publishes them as packages in this repository.  Install Package locally - > npm install <package_name>  Install Package globally - > npm install <package_name> - g  Update Package - > npm update <package_name>  Uninstall Package - > npm uninstall <package_name> Node Package Manager (NPM)
  • 13. Session II completed Address: 403, Venus Benecia, Bodakdev,Ahmedabad – 380053 Reach us : reach@techforceinfotech.com Contact no: +91 (79) 48904529