Books
Learn HTML
Learn CSS
Learn Git
Learn Javascript
Learn PHP
Learn python
Learn Java
Exercises
HTML
JavaScript
Git
CSS
PHP
Courses
Quizzes
Snippets
Tools
General Tools
Password Generator
HTML Editor
HTML Encoder
Base 64
Code Diff
JSON Beautifier
CSS Beautifier
Markdown Convertor
Find the Closest Tailwind CSS Color
Phrase encrypt / decrypt
Browser Feature Detection
Number convertor
JTW Decoder
CSS Maker
CSS Maker
CSS Maker text shadow
CSS Maker Text Rotation
CSS Maker Out Line
CSS Maker RGB Shadow
CSS Maker Transform
CSS Maker Font Face
Color Tools
Color Picker
Colors CMYK
Colors HWB
Colors HSL
Color Hex
Color mixer
Color Converter
Colors RGB
Color Contrast Analyzer
Color Gradient
String Tools
String Length Calculator
MD5 Hash Generator
Sha256 Hash Generator
String Reverse
URL Encoder
URL Decoder
Base 64 Encoder
Base 64 Decoder
Extra Spaces Remover
String to Lowercase
String to Uppercase
Word Count Calculator
Empty Lines Remover
HTML Tags Remover
Binary to Hex
Hex to Binary
Rot13 Transform on a String
String to Binary
Duplicate Lines Remover
EN
DE
RU
FR
ES
Change theme
Dark
Light
System
Books
Learn HTML
Learn CSS
Learn Git
Learn Javascript
Learn PHP
Learn python
Learn Java
How To
How To NodeJs
How To Linux
How To AngularJs
How To PHP
How To HTML
How To CSS
How To Symfony
How To Git
How To Apache
How To JavaScript
How To Java
How To Vue.js
How To Python
NodeJS Basics
1/25
What command is used to remove a package in Node.js using npm?
npm delete package-name
npm remove package-name
npm uninstall package-name
Next >
2/25
Which of the following is an EventEmitter function used to register a listener for a named event?
event.on()
event.listen()
event.register()
Next >
3/25
What is the main difference between npm and npx?
npm is a package manager, while npx is a tool to execute packages
npx is a JavaScript runtime, npm is not
npm installs packages globally, while npx does not
There is no difference; they are the same tool
Next >
4/25
Which of the following methods can be used to prevent a program from exiting immediately in Node.js?
process.exit()
process.stayAlive()
setInterval()
Next >
5/25
Which Node.js module is used to work with file paths?
fs
path
file
Next >
6/25
How can you capture command line arguments in a Node.js application?
Using process.argv
Using console.args
Using process.arguments
Next >
7/25
What is the significance of package-lock.json in a Node.js project?
It locks the versions of the packages installed
It automatically updates packages to their latest versions
It is a backup of the package.json file
It speeds up the npm install process
Next >
8/25
How can you ensure that a function is executed after all callbacks have completed in Node.js?
Using the async module's series method
Using the Promise.all method
By nesting callbacks
Using the EventEmitter class
Next >
9/25
In Node.js, which method is used to spawn a child process?
process.spawn()
child_process.spawn()
system.spawnProcess()
Next >
10/25
How do you enable strict mode in a Node.js file?
use strict;
enable strict;
strict mode;
Next >
11/25
Which method in the fs module is used to asynchronously delete a file?
fs.unlink()
fs.remove()
fs.delete()
Next >
12/25
What is the purpose of the 'util.promisify' function in Node.js?
To convert a callback-based function into a promise-based one
To create a new Promise object
To optimize utility functions for performance
Next >
13/25
How can you securely store sensitive data like passwords in Node.js applications?
Using the crypto module for hashing and encryption
Storing them in a .env file as plain text
Using local storage for persistence
Encrypting them with the fs module
Next >
14/25
In Node.js, how can you listen for and respond to uncaught exceptions?
process.on('uncaughtException', function(err) {});
try...catch on the global level
window.onerror for Node.js applications
Next >
15/25
How can you access the query string parameters in an Express route?
req.query
req.params
req.body
Next >
16/25
Which of the following are considered best practices in Node.js error handling?
Using try/catch for synchronous code
Using process.on('error', callback) for global error handling
Handling errors at the root level of the application
Using Promises or async/await for asynchronous error handling
Next >
17/25
Which module is used to create a web server in Node.js?
http
server
net
Next >
18/25
In Node.js, what does the 'path.join()' method do?
Joins all given path segments together
Joins two arrays into one
Concatenates two strings
Next >
19/25
How do you send a status code of 404 with a message in Express?
res.status(404).send('Not Found')
res.send(404, 'Not Found')
res.sendStatus('404 Not Found')
Next >
20/25
What are Promises in Node.js used for?
To handle asynchronous operations
To execute multiple callbacks sequentially
To generate cryptographic keys
Next >
21/25
Which function is used to read data from a readable stream in Node.js?
stream.read()
stream.getData()
stream.fetch()
Next >
22/25
What is the command to list installed packages in a Node.js project?
npm list
npm installed
node list-packages
Next >
23/25
How can template literals be used in Node.js?
For defining SQL queries
To concatenate strings and variables
To create HTML templates
Next >
24/25
How do you make an HTTP POST request using the Axios library in Node.js?
axios.post('/url', { data })
axios('/url', 'POST', { data })
axios.send('POST', '/url', { data })
Next >
25/25
What is the difference between 'exports' and 'module.exports' in Node.js?
'exports' is a shorthand for 'module.exports'
'exports' can export multiple objects, functions, or values
'module.exports' can only export a single object, function, or value
Next >
To get the result of the quiz, please provide your email address (optional)..
Get Certificate
It seems you haven't answered any questions yet. Please provide your answers to proceed.