Online Exam Quiz

questionQuestion  1 to 30

What does 'process.exit()' do in Node.js?

  • Ends the process
  • Starts a new process
  • Restarts the process
  • Pauses the process
Mark for review

What is the purpose of 'app.use()' in Express?

  • To define routes
  • To handle HTTP methods
  • To add middleware
  • To listen for connections
Mark for review

How do you install a package globally using npm?

  • npm install package
  • npm install package -g
  • npm global install package
  • npm add package
Mark for review

What does the 'req.params' object contain in Express?

  • Route parameters
  • Query parameters
  • Header information
  • Cookie data
Mark for review

How can you create a promise in Node.js?

  • new Promise()
  • Promise.create()
  • createPromise()
  • promise()
Mark for review

What does the 'req.query' object contain in Express?

  • Query string parameters
  • Route parameters
  • Header information
  • Cookie data
Mark for review

What does the 'path' module provide?

  • A way to handle file paths
  • HTTP server functionality
  • Cryptographic functions
  • Database access
Mark for review

Which of the following is a Node.js web application framework?

  • Ruby on Rails
  • Laravel
  • Express
  • Django
Mark for review

How do you export a function in Node.js?

  • module.exports = myFunction
  • exports.myFunction = myFunction
  • export myFunction
  • Both module.exports = myFunction and exports.myFunction = myFunction
Mark for review

What is the purpose of the 'res' object in Express?

  • To handle HTTP requests
  • To handle HTTP responses
  • To parse URL parameters
  • To manage sessions
Mark for review

How can you handle file uploads in Express?

  • Using 'body-parser'
  • Using 'express-fileupload'
  • Using 'fs' module
  • Using 'multer'
Mark for review

What is the purpose of the 'app.listen()' function in Express?

  • To create a server
  • To start listening for connections
  • To handle GET requests
  • To handle POST requests
Mark for review

What is the default port number for an HTTP server in Node.js?

  • 3000
  • 8080
  • 8000
  • 80
Mark for review

What is npm?

  • Node Programming Method
  • Node Package Manager
  • New Programming Module
  • None of the above
Mark for review

What is the purpose of the 'next' parameter in Express middleware?

  • To handle the next request
  • To pass control to the next middleware function
  • To end the response
  • To start a new session
Mark for review

How do you start a Node.js application?

  • node app.js
  • start app.js
  • run app.js
  • execute app.js
Mark for review

What is the default scope in Node.js modules?

  • Global
  • Local
  • Block
  • Module
Mark for review

Which of the following is a middleware function in Express?

  • app.use()
  • app.listen()
  • app.get()
  • app.route()
Mark for review

Which command is used to check the Node.js version?

  • node -v
  • node --version
  • node version
  • Both node -v and node --version
Mark for review

How can you create a new project with npm?

  • npm new
  • npm create
  • npm init
  • npm start
Mark for review

Which method is used to parse JSON data in Node.js?

  • JSON.parse()
  • JSON.stringify()
  • JSON.toString()
  • JSON.convert()
Mark for review

What is 'body-parser' used for in Express?

  • To parse incoming request bodies
  • To handle cookies
  • To manage sessions
  • To serve static files
Mark for review

Which command is used to uninstall a package using npm?

  • npm delete package
  • npm remove package
  • npm uninstall package
  • npm unpackage
Mark for review

How can you create a buffer in Node.js?

  • Buffer.alloc()
  • Buffer.create()
  • new Buffer()
  • Both Buffer.alloc() and new Buffer()
Mark for review

What does 'npm init' command do?

  • Installs npm
  • Initializes a new Node.js project
  • Updates npm
  • Removes npm
Mark for review

How do you serve static files in Express?

  • app.static()
  • express.static()
  • app.serve()
  • express.serve()
Mark for review

What does the 'fs' module stand for?

  • File Stream
  • File System
  • File Structure
  • File Server
Mark for review

What is the purpose of 'package.json'?

  • To manage project dependencies
  • To configure the database
  • To handle HTTP requests
  • To serve static files
Mark for review

What is 'nodemon'?

  • A Node.js module
  • A package manager
  • A tool that automatically restarts Node.js applications
  • A web server
Mark for review

How can you create a server in Node.js?

  • http.createServer()
  • httpServer.create()
  • server.create()
  • server.httpCreate()
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review