Node.js Quiz | Set-1 Read Discuss Courses Node.js Quiz | Set-1 Please wait while the activity loads. If this activity does not load, try refreshing your browser. Also, this page requires javascript. Please visit using a browser with javascript enabled. If loading fails, click here to try again Question 1Node.js is written inJavaScriptCC++All of the aboveNode.js Quiz | Set-1 Discuss itQuestion 1-Explanation: Node.js is a backend JavaScript Framework. NodeJS is written on JavaScript, C, C++.Question 2How modules in Node.js can be connected from one component to another ?ExposeModuleExportsAll of the aboveNode.js Quiz | Set-1 Discuss itQuestion 2-Explanation: Exports in Node.js are used to export the component from one module to another. It can also export to literal, function, or object. It is responsible for including the JavaScript file into the node.js applications.Question 3 Which of the below modules is not a built-in module in Node.js ?zlibHTTPSdgramfsreadNode.js Quiz | Set-1 Discuss itQuestion 3-Explanation: The fsread modules is not a built-in node module in Node.js. Reading and writing are performed in all of the applications. Node.js has many inbuild modules to perform read and write the application.fs package contains the function required in file operations.Question 4Which of the below command will show all the modules installed locally ?npm ls -gnpm lsnode ls -gnode lsNode.js Quiz | Set-1 Discuss itQuestion 4-Explanation: The npm ls command print all the versions of packages that are installed locally in the system, It also displays all the dependencies that are present in the tree structure.Question 5Which of the below fs module is used to truncate a file ?fs.delete(fd, len, callback)fs.remove(fd, len, callback)fs.ftruncate(fd, len, callback)None of the above.Node.js Quiz | Set-1 Discuss itQuestion 5-Explanation: The fs.ftruncate() method in Node.js is used to change the size of the files It increases or decreases the size of the file. Or it changes the length of the file by len bytes If len is shorter than the file’s current length, the file is truncated to that length. It takes 3 parameters as fd, len, and callback.Question 6 Which template engines can be used with Node.js ? Jade Vash Handlebars All of the above Node.js Quiz | Set-1 Discuss itQuestion 6-Explanation: Jade, Vash, and Handlebars are template engines that can be used with Node.js. Question 7How do we return a path string from the given path object in Node.js ?path.get()path.set()path.format()path.return()Node.js Quiz | Set-1 Discuss itQuestion 7-Explanation: The path. format() method is used to return a path string from the given path object. The method has some rules where one path property gets more priority over another.Question 8 What is the default scope in the Node.js application ? Global Local Global Function Local to object Node.js Quiz | Set-1 Discuss itQuestion 8-Explanation: Local is the default scope in the Node.js application. Local variables are defined within the function. Variable has the local scope it means that they can only be used within the function that defines them. // 2 option is the same, and is mentioned as "A" but in the explanation it is B Question 9Which of the below method is used to return the current working directory of the process ?cwd();cmd();pwd();None of the aboveNode.js Quiz | Set-1 Discuss itQuestion 9-Explanation: The cwd() method in Node.js is used to get the current working directory of the process.Question 10Which below method is used to check whether the given path is an absolute path or not in Node.js ?path.Query()path.render() path.isAbsolute() path.Absolute()Node.js Quiz | Set-1 Discuss itQuestion 10-Explanation: The path.isAbsolute() tell the path is absolute or not. It needed complete detail to locate the file. It accepts a single parameter A. The return value in this method specifies the path is absolute or not if it returns false as a value it means that path ios on zero-length. 12 There are 15 questions to complete. You have completed questions question Your accuracy is Correct Wrong Partial-Credit You have not finished your quiz. If you leave this page, your progress will be lost. Correct Answer You Selected Not Attempted Final Score on Quiz Attempted Questions Correct Attempted Questions Wrong Questions Not Attempted Total Questions on Quiz Question Details Results Date Score Hint Time allowed minutes seconds Time used Answer Choice(s) Selected Question Text All doneNeed more practice!Keep trying!Not bad!Good work!Perfect! Last Updated : 27 Sep, 2023