What is Node.js?
Example:
console.log('Hello, Node.js!');
Save For Revision
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
WithoutBook brings subject-wise interview questions, online practice tests, tutorials, and comparison guides into one responsive learning workspace.
Know the top NodeJS interview questions and answers for freshers and experienced candidates to prepare for job interviews.
Know the top NodeJS interview questions and answers for freshers and experienced candidates to prepare for job interviews.
Search a question to view the answer.
Example:
console.log('Hello, Node.js!');
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
npm install package_name
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
npm init
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
global.myVariable = 'Hello';
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const fs = require('fs');
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const os = require('os');
console.log(os.totalmem());
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const fs = require('fs');
fs.readFile('file.txt', 'utf8', (err, data) => { /* handle file content */ });
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const url = require('url');
const parsedUrl = url.parse('https://example.com/path?query=value', true);
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
require('dotenv').config();
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const server = require('http').createServer((req, res) => { /* handle request */ });
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
app.use((req, res, next) => { /* middleware logic */ next(); });
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
fs.readFile('file.txt', 'utf8', (err, data) => { /* handle file content */ });
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
console.log(process.env.NODE_ENV);
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
process.nextTick(() => { console.log('Next Tick'); });
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const buffer = Buffer.from('Hello, Node.js');
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
console.log('Start');
setTimeout(() => console.log('Timeout'), 1000);
console.log('End');
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const path = require.resolve('path');
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
app.use((req, res, next) => { /* middleware logic */ next(); });
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
module.exports = { key: 'value' };
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const { spawn } = require('child_process');
const child = spawn('ls', ['-l']);
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const net = require('net');
const server = net.createServer((socket) => { /* handle connection */ });
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const cluster = require('cluster');
if (cluster.isMaster) { /* create workers */ } else { /* start server logic */ }
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const crypto = require('crypto');
const hash = crypto.createHash('sha256').update('Hello').digest('hex');
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
"scripts": { "start": "node index.js", "test": "mocha test/*.js" }
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
try { /* code that may throw an error */ } catch (error) { /* handle error */ }
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const EventEmitter = require('events');
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();
myEmitter.on('event', () => console.log('Event emitted'));
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 8080 });
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
app.use(middleware1);
app.use(middleware2);
app.use(middleware3);
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
pm2 start app.js
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Example:
const cors = require('cors');
app.use(cors());
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.