Node.js Quiz Node js Quiz 1 / 20What is Node.js? A front-end JavaScript framework A back-end JavaScript runtime environment A database A CSS framework 2 / 20Which engine powers Node.js? SpiderMonkey Chakra V8 JavaScriptCore 3 / 20Which module is used in Node.js to handle file system operations? http path os fs 4 / 20How do you import a module in Node.js? import moduleName from 'moduleName' include 'moduleName' require('moduleName') using moduleName 5 / 20Which method is used to create a server in Node.js? http.createServer() http.server() net.createServer() fs.createServer() 6 / 20What does the npm stand for? Node Package Manager Network Protocol Manager New Programming Method Node Programming Module 7 / 20Which command is used to initialize a new Node.js project? npm start npm init npm new npm create 8 / 20What file is typically used to define a Node.js project's metadata and dependencies? config.json package.json node.json settings.json 9 / 20Which of the following is a core module in Node.js? express react lodash events 10 / 20How do you read environment variables in Node.js? process.env global.env env.process node.env 11 / 20Which 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 / 20What 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 / 20How 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 / 20Which of the following is a popular framework for Node.js? Angular Express Django Laravel 15 / 20How can you install a package globally using npm? npm install package npm install package -g npm add package -global npm get package -g 16 / 20What does the require function return? A promise A function The module's exports A string 17 / 20Which 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 / 20Which method is used to append data to a file in Node.js? fs.writeFile fs.appendFile fs.addFile fs.modifyFile 19 / 20What is the command to update npm to the latest version? npm update -g npm upgrade npm install npm@latest -g npm version upgrade 20 / 20How do you exit a Node.js process? exit() process.exit() quit() stop() Your score isThe average score is 71% 0% Restart quiz