Node.js Quiz Node js Quiz 1 / 20 What is Node.js? A front-end JavaScript framework A back-end JavaScript runtime environment A database A CSS framework 2 / 20 Which engine powers Node.js? SpiderMonkey Chakra V8 JavaScriptCore 3 / 20 Which module is used in Node.js to handle file system operations? http path os fs 4 / 20 How do you import a module in Node.js? import moduleName from 'moduleName' include 'moduleName' require('moduleName') using moduleName 5 / 20 Which method is used to create a server in Node.js? http.createServer() http.server() net.createServer() fs.createServer() 6 / 20 What does the npm stand for? Node Package Manager Network Protocol Manager New Programming Method Node Programming Module 7 / 20 Which command is used to initialize a new Node.js project? npm start npm init npm new npm create 8 / 20 What file is typically used to define a Node.js project's metadata and dependencies? config.json package.json node.json settings.json 9 / 20 Which of the following is a core module in Node.js? express react lodash events 10 / 20 How do you read environment variables in Node.js? process.env global.env env.process node.env 11 / 20 Which of the following is true about Node.js? It is synchronous by default. It uses an event-driven, non-blocking I/O model. It is used mainly for CPU-intensive applications. It cannot be used with databases. 12 / 20 What does the __dirname variable represent in Node.js? The directory name of the current module The directory name of the operating system The directory name of the user's home folder The directory name of the current process 13 / 20 How do you handle exceptions in Node.js? using the 'catch' block using the 'try...catch' block using the 'except' block using the 'finally' block 14 / 20 Which of the following is a popular framework for Node.js? Angular Express Django Laravel 15 / 20 How can you install a package globally using npm? npm install package npm install package -g npm add package -global npm get package -g 16 / 20 What does the require function return? A promise A function The module's exports A string 17 / 20 Which of the following is used to create a buffer in Node.js? Buffer.alloc(size) new Buffer(size) Buffer.create(size) buffer.make(size) 18 / 20 Which method is used to append data to a file in Node.js? fs.writeFile fs.appendFile fs.addFile fs.modifyFile 19 / 20 What is the command to update npm to the latest version? npm update -g npm upgrade npm install npm@latest -g npm version upgrade 20 / 20 How do you exit a Node.js process? exit() process.exit() quit() stop() Your score isThe average score is 71% 0% Restart quiz