WorksheetsNode basics
Total questions: 12
Worksheet time: 4mins
What is the right syntax for importing a module?
require()
function()
import()
module.import()
What JavaScript Engine is used by Google Chrome?
Y8
Adobe Flash Player
Friv
V8
Which of the following command is used to run a node.js program?
node run main.js
node start main.js
start main.js
node main.js
Where should local Node.js modules typically be stored in a project?
A) Inside the node_modules folder
B) Inside the modules folder
C) Anywhere in the project, usually with a ./ path for referencing
D) Inside the bin folder
Which of the following core module is used for file system operations in Node.js?
A) http
B) fs
C) path
D) querystring
D) querystring
In a local Node.js module, how do you export a function so it can be used in another file?
A)exports.myFunction = function() {...}
B) export default function() {...}
C) module.exports = function() {...}
D) define(function() {...})
What is the purpose of the npm command in Node.js?
A) To manage global Node.js installations
B) To create a new Node.js project
C) To install and manage packages/modules for a Node.js project
D) To execute JavaScript code directly from the command line
