Following quiz provides Multiple Choice Questions (MCQs) related to Node.js Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - Which of the following statement is valid to use a Node module http in a Node based application?
Require directive is used to load a Node module(http) and store returned its instance(http) into its variable(http).
Q 2 -What npm stands for?
npm stands for Node Package Manager.
Q 3 - Which of the following is true about EventEmitter.on property?
on property is used to bind a function with the event.
Q 4 - Which method of fs module is used to read a file?
fs.read(fd, buffer, offset, length, position, callback) is the method which is used to read a file.
Q 5 - Which method of fs module is used to remove a directory?
fs.rmdir(path, callback) is the method which is used to remove a directory.
Q 6 - Which of the following is true about process global object?
The process object is an instance of EventEmitter and emits the above mentioned events.
Q 7 - Which of the following is the correct way to get an extension of a file?
path.extname(p) returns the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.
net.isIP(input) tests if input is an IP address. Returns 0 for invalid strings, returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses.
Q 9 - Which of the following is true about exec methd of child_process module.
child_process.exec method runs a command in a shell and buffers the output. It returns a buffer with a max size and waits for the process to end and tries to return all the buffered data at once.
A stream fires data event when there is data available to read.