Lab Manual PS2
Lab Manual PS2
POTE PATIL
M3- To develop human resources with ethical and moral values for
overall personality development to serve the society.
Program Outcomes:
Engineering Graduate will be able to:
1. Engineering Knowledge: Apply the knowledge of mathematics,
science, engineering fundamentals, and an engineering specialization
to the solution of complex engineering problems.
2. Problem Analysis: Identify, formulate, research literature, and
analyze complex engineering problems reaching substantiated
conclusions using first principles of mathematics, natural sciences, and
engineering sciences.
3. Design /development of solutions: Design solutions for complex
engineering problems and design system components or processes
that meet the specified needs with appropriate consideration for the
public health and safety, and the cultural, societal, and environmental
considerations.
4. Conduct investigations of complex problems: Use research-based
knowledge and research methods including design of experiments,
analysis and interpretation of data, and synthesis of the information to
provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques,
resources, and modern engineering and IT tools including prediction
and modeling to complex engineering activities with an understanding
of the limitations.
6. The engineer and society: Apply reasoning informed by the
contextual knowledge to assess societal, health, safety, legal and
cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
7. Environment and sustainability: Understand the impact of the
professional engineering solutions in societal and environmental
contexts, and demonstrate the knowledge of, and need for sustainable
development.
8. Ethics: Apply ethical principles and commit to professional ethics and
responsibilities and norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and
as a member or leader in diverse teams, and in multidisciplinary
settings.
10. Communication: Communicate effectively on complex engineering
activities with the engineering community and with society at large,
such as, being able to comprehend and write effective reports and
design documentation, make effective presentations, and give and
receive clear instructions.
11. Project management and finance: Demonstrate knowledge and
learning.
PSO:
hardware projects.
Teachers shall discuss the following points with students before start of
practical of the subject.
1. Learning Overview: To develop better understanding of importance of the
skills.
groups, planning time etc. also to know total amount of work to be done in
the laboratory.
9. Teacher should ensure that the respective skills are developed in the
10.Teacher may provide additional knowledge and skills to the students even
though not covered in the manual but are expected from students by the
industries.
11.Teacher may suggest the students to refer additional related literature of the
1. Students shall read the points given below for understanding the theoretical
concepts and practical applications.
2. Listen carefully to the lecture given by teacher about importance of subject,
curriculum philosophy, learning structure, skills to be developed, information
about equipment, instruments, procedure, method of continuous
assessment, tentative plan of work in laboratory and total amount of works
to be done in a semester.
3. Student shall undergo study visit of the laboratory for types of equipment,
and material to be used, before performing experiments.
4. Read the write up of each experiment to be performed, a day in advance.
5. Organize the work in the group and make a record of all observations.
6. Understand the purpose of experiment and its practical implications.
7. Student should not hesitate to ask any difficulty faced during conduct of
practical /exercise.
8. Write the answers of the questions allotted by the teacher during practical
hours if possible or afterwards, but immediately.
9. Student should develop the habit of pear discussion / group discussion
related to experiments / exercise so that exchanges of knowledge / skills
could take place.
10.Students shall attempt to develop related hands-on-skills and gain
confidence.
11.Student shall focus on development of skills rather than theoretical or
codified knowledge.
P. R. POTE PATIL
COLLEGE OF ENGINEERING & MANAGEMENT, AMRAVATI.
Certificate
Head of the
Subject Teacher
Department
Roll No _____________________
Date of Date of
Title of the Sign of
SN. Performanc Submissio
Practical / Experiment Teacher
e n
Explore the concept of NodeJS & Setup
1 its environment for development. Run
a Node Js program to print ‘Hello world’
Accomplish the concept of HTTP
2
module & Run a program in NodeJS.
Perform various operations like create,
3 update, rename & delete using file
system Module in NodeJS
4 Execute the concept of URL Module .
Signature of Faculty
Course Outcomes
S
Outcomes
N
After successful completion of laboratory course, the students will able to
1 Examine various Node.js core modules, including HTTP, File System, URL, and
Event modules.
2 Implement Node.js modules to establish HTTP servers, process URLs, and
manipulate files dynamically
3 Assess and troubleshoot the setup and configuration of Node.js and MongoDB
environments
4 Develop and execute Node.js programs for file system operations, CRUD in
MongoDB, and event handling.
5 Integrate MongoDB with Node.js to design and manage a database with CRUD
operations efficiently.
Allocate
Skills Parameters High Medium Low
d Marks
1. Handle equipment/
Most Partially Below
tools/ commands
satisfactory successful expectation
correctly or Logic
(4-5) (3) (0-2)
Formation (5)
Exceptional Satisfactor Unsatisfactory
2. Work cohesively in
(2) y (1) (0)
Proces team (2)
s Partially
15
Relate 1. Integrate system & correct (2- Incorrect or
d Skills measure parameters Highly 3) unsatisfactory
correctly or Debugging satisfactory (0-1)
Ability (4) (4) *Complete *Completed
2. Completed experiment In time (4) d but with 50%
as per schedule (4) delayed delayed (1)
(2)
Partially
Obtain correct results, Highly
correct (2- Incorrect (0-1)
Interpret results (4) Accurate (4)
Produc 3)
t Highly Partially Unsatisfactory
Draw conclusion (3)
Relate 10 accurate (3) (2) (1)
d Skills Answer practical related
Highly Moderate
questions & submit the Unsatisfactory
satisfactory satisfactor
write up of expt on time (1)
(3) y (2)
(3)
Assessment
PRACTICAL NO. 1
AIM: Explore the concept of NodeJS & Setup its environment for development.
Run a Node Js program to print ‘Hello world’
THEORY:
Introduction to Node.js-
Node.js is a cross-platform environment and library for running JavaScript
applications which is used to create networking and server-side applications.
It is used for creating server-side and networking web applications. It is open
source and free to use. It can be downloaded from this link https://nodejs.org/en/
Node.js is mostly used to run real-time server applications.
Node.js files contain the task that will be executed on certain event.
A typical event is someone trying to access to a part of server.
Node.js files must be initiated on the server before having any effect.
Node.js files have extension “ .js”
Node.js uses asynchronous programming. A common task for a web server can
be to open a files on the server & return the content to the client.
When the file system has opened and read the file , the server returns
the content to the file .
Node.js eliminates the waiting and simply continues with the next
request.
Node.js runs single threaded , non-blocking asynchronous programing
which is very memory efficient .
Installation
Download Node.js from official Node.js website .https://nodejs.org
To install and setup an environment for Node.js, you need the following two
software’s available on your computer:
1. Text Editor.
2. Node.js Binary installable
3. Text Editor:
4. 1.The text editor is used to type your program. For example: Notepad is
used in Windows, vim or vi can be used on Windows as well as Linux or
UNIX. The name and version of the text editor can be different from
operating system to operating system.
5. 2.The files created with text editor are called source files and contain
program source code. The source files for Node.js programs are typically
named with the extension ".js".
The source code written in source file is simply JavaScript. It is interpreted and
executed by the Node.js interpreter.
You can download the latest version of Node.js installable archive file
from https://nodejs.org/en/
Here, you deploy the installation of node-v4.4.2 LTS recommended for most
users.
Ready to install:
CONCLUSION:
ASSESSMENT SCHEME:
PRACTICAL NO. 2
AIM: Accomplish the concept of HTTP module & Run a program in NodeJS.
Built-In modules
Node.js has set of built in modules which you can use without any further
installation.
Modules Description
Assert Provides a set of assertion task
Buffer To handle the binary data
Child-process To run a child process
Cluster To split a single node process into multiple processes.
Crypto To handle open SSL cryptographic function
Dgram Provides implementation of UDP diagram socket
Dns To do DNS lookups and name resolution functions
Domain Deprecated. To handle unhandled errors.
Events To handle the events
Fs To handle the file system
http To make node.js act as a http server
https To make node.js act as a https server
Net To create the servers & clients
Os Provide info about the operation system
Path To handle the file paths
Punycode Deprecated. A character encoding scheme.
Query string To handle URL query string
Readline To handle readable strings one at a time.
Stream To handle the streaming data
String decoder To decode buffer objects into strings
Timers To execute the function after the given number of ms
Tls To implement TLS & SSL protocol
Tty Provides classes use by text terminal
url To parse url string
Util To access the utility functions
V8 To access the information about javascript engine(v8)
Vm To compile javascript code into the virtual machine
Zlib To compress or decompress the file
Node.js has a built-in module called HTTP, which allows Node.js to transfer data
over the Hypertext Transfer Protocol (HTTP). The HTTP module can create an
HTTP server that listens to server ports and gives a response back to the client.
There are variety of modules such as “http” & “request” module which helps in
processing the server related requests in the web server space.
We will have a look how we can create a basic web server application using
Node.js
Program Input:
Program Output:
CONCLUSION:
ASSESSMENT SCHEME:
PRACTICAL NO. 3
AIM: To study and implement Node.js File system module to read, write, create,
update, delete and rename the file.
THEORY: The Node.js file system module allows you to work with the file
system on your computer. To include the file system module , use the require()
method.
Var fs=require(‘fs’);
Common use for the file system module:
Read files
Create files
Update files
Delete files
Rename files
Program code:
Program Output:
CONCLUSION:
ASSESSMENT SCHEME:
PRACTICAL NO. 4
AIM: Execute the concept of URL Module . Run a program to split a web address
into readable parts using url.parse() method
THEORY: The URL module splits up a web address into readable parts.
Program Input:
Program Output:
CONCLUSION:
ASSESSMENT SCHEME:
PRACTICAL NO. 5
OBJECTIVES:
(a) To study event handling in Node JS and demonstrate it using Event Module
and Event Emitter Object
(b) To demonstrate using event module & event emitter object
SOFTWARE: Node JS
Objects in Node.js can fire events, like the readStream object fires events when
opening and closing a file:
Example,
var fs = require('fs');
var rs = fs.createReadStream('./demofile.txt');
rs.on('open', function () {
console.log('The file is open');
});
Node.js has a built-in module, called "Events", where you can create, fire, and
listen for- your own events.To include the built-in Events module use
the require() method. In addition, all event properties and methods are an
instance of an EventEmitter object. To be able to access these properties and
methods, create an EventEmitter object:
Program code:
Program Output:
CONCLUSION:
ASSESSMENT SCHEME:
PRACTICAL NO. 6
AIM: Explore the database MongoDB & setup its environment for development.
Create a MongoDB document using fields numbers, strings, boolean, arrays, or
even nested documents.
THEORY:
JSON (JavaScript Object Notation) is a lightweight data format used for storing
and exchanging data in a human-readable format. It represents data as key-
value pairs enclosed in curly braces {} and supports various data types like
strings, numbers, arrays, and objects. MongoDB uses BSON (Binary JSON), an
extended version of JSON, for efficient storage and retrieval. Due to its simplicity
and flexibility, JSON is widely used in NoSQL databases, APIs, and web
applications.
1. Install MongoDB:
After downloading it Extract the folder and navigate to all folder inside it
till Bin occurs. Go inside Bin and copy the path of this location.
After copying this path we need to add the Environment variable to the
system. Search in search bar “Add environment variable”
After clicking edit new window will open, click on “New” button and paste
copied path to last blank space then hit “OK”
Output:
CONCLUSION: .
ASSESSMENT SCHEME:
PRACTICAL NO. 7
THEORY: MongoDB does not require manually creating a database before use. A
database is created automatically when data is first inserted. Similarly,
collections, which store documents, are automatically created when data is
added. Collections in MongoDB are equivalent to tables in relational databases
but are more flexible, as they do not enforce a fixed schema. Each collection can
contain multiple documents with different structures. MongoDB uses BSON
(Binary JSON) format to store data efficiently. Unlike traditional SQL databases,
MongoDB is designed for scalability, high performance, and easy handling of
unstructured data.
MongoDB provides commands in mongosh to check, create, and manage
databases and collections.
mongosh
use myDatabase
o Command:
db.createCollection("students")
show collections
exit
Output:
ASSESSMENT SCHEME:
PRACTICAL NO. 8
AIM: Apply Insert operation in MongoDB to insert a document into collection &
run a program into NodeJS.
THEORY:
MongoDB stores data in the form of JSON-like documents inside collections. The
insertOne method is used to insert a single document, while insertMany allows
multiple documents to be added at once. The find command helps in retrieving
stored documents from a collection. MongoDB dynamically creates collections
when the first document is inserted. Unlike SQL databases, there is no need to
define a schema before inserting data.
o Command: exit
Output:
CONCLUSION:
ASSESSMENT SCHEME:
PRACTICAL NO. 9
THEORY:
MongoDB provides methods to remove data. The deleteOne method removes a
single document that matches the given criteria, while deleteMany removes
multiple matching documents. The drop method is used to delete an entire
collection, including its indexes.
MongoDB stores data in the form of JSON-like documents inside collections. The
insertOne method is used to insert a single document, while insertMany allows
multiple documents to be added at once. The find command helps in retrieving
stored documents from a collection. MongoDB dynamically creates collections
when the first document is inserted. Unlike SQL databases, there is no need to
define a schema before inserting data.
Output:
CONCLUSION:
ASSESSMENT SCHEME:
PRACTICAL NO. 10
THEORY:
use myDatabase
Output:
CONCLUSION:
ASSESSMENT SCHEME:
Process Related Product Related Total Signature of
Skills Skills (25-M) Faculty
(15-M) (10-M)