XJavascript.com
Toggle Menu
Home
Online Javascript Compiler
Tutorials
JavaScript Tutorials
TypeScript Tutorials
Blog
All Posts
Node.js Essentials
Check your understanding of Node.js modules,event-driven programming,and file systems.
1. What type of runtime environment is Node.js primarily designed for?
Client-side web development
Server-side scripting
Mobile application development
Desktop GUI applications
2. Which of the following are core modules in Node.js?
fs
express
path
react
3. Node.js is single-threaded by default.
True
False
4. What does 'npm' stand for (full name)?
5. Which object provides access to command-line arguments in Node.js?
process.argv
global.args
console.input
env.parameters
6. Which of the following are valid ways to export modules in Node.js (CommonJS)?
module.exports
export default
exports
return statement
7. The 'require()' function in Node.js loads modules asynchronously.
True
False
8. What is the name of the mechanism that allows Node.js to handle non-blocking I/O operations efficiently?
9. Which core module is used to create an HTTP server in Node.js?
http
server
net
web
10. Which of the following are asynchronous operations in Node.js?
fs.readFile()
setTimeout()
fs.readFileSync()
setImmediate()
11. Node.js can directly access the DOM (Document Object Model) like a web browser.
True
False
12. What command initializes a new Node.js project and creates a package.json file?
13. Which method is used to make a Node.js HTTP server listen for incoming requests?
server.listen()
http.start()
server.run()
http.listen()
14. Which of the following are error-handling patterns in Node.js callbacks?
First parameter as error object
Using try/catch blocks
Throwing errors with throw keyword
error event listeners
15. Async/await is a syntactic sugar over Promises in Node.js.
True
False
16. What is the default file name for the entry point of a Node.js application when running 'node .'?
17. Which core module provides utilities for working with file and directory paths?
path
fs
dir
file
18. Which of the following are core modules in Node.js for network operations?
http
net
dns
socket.io
19. Node.js is built on the V8 JavaScript engine developed by Google.
True
False
20. What is the primary purpose of the 'Buffer' class in Node.js?
Storing and manipulating binary data
Caching HTTP responses
Managing memory leaks
Handling JSON data
Reset
Answered 0 of 0 — 0 correct