Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Node basics

Total questions: 12

Worksheet time: 4mins

Name
Class
Date
1.

What is the right syntax for importing a module?

a)

require()

b)

function()

c)

import()

d)

module.import()

2.

What JavaScript Engine is used by Google Chrome?

a)

Y8

b)

Adobe Flash Player

c)

Friv

d)

V8

3.

Which of the following command is used to run a node.js program?

a)

node run main.js

b)

node start main.js

c)

start main.js

d)

node main.js

4.

Where should local Node.js modules typically be stored in a project?

a)

A) Inside the node_modules folder

b)

B) Inside the modules folder

c)

C) Anywhere in the project, usually with a ./ path for referencing

d)

D) Inside the bin folder

5.

Which of the following core module is used for file system operations in Node.js?

a)
  • A) http

b)
  • B) fs

c)
  • C) path

  • D) querystring

d)
  • D) querystring

6.

In a local Node.js module, how do you export a function so it can be used in another file?

a)
  • A)exports.myFunction = function() {...}

b)
  • B) export default function() {...}

c)
  • C) module.exports = function() {...}

d)
  • D) define(function() {...})

7.

What is the purpose of the npm command in Node.js?

a)
  • A) To manage global Node.js installations

b)
  • B) To create a new Node.js project

c)
  • C) To install and manage packages/modules for a Node.js project

d)
  • D) To execute JavaScript code directly from the command line

8.
What is Node.js?
a)
A front-end framework
b)
A back-end JavaScript runtime environment
c)
A database management system
d)
A browser extension
9.
What is the primary use of Node.js?
a)
To build interactive user interfaces
b)
To develop mobile applications
c)
To write server-side applications
d)
To create graphics and animations
10.
Which of the following is true about Node.js?
a)
It's a compiled language
b)
It's single-threaded and asynchronous
c)
It's primarily used for desktop applications
d)
It's not suitable for web development
11.
Which of the following modules is a built-in module in Node.js?
a)
express
b)
path
c)
request
d)
mongoose
12.
What does 'npm' stand for?
a)
Node Package Manager
b)
New Programming Module
c)
Node Project Manager
d)
Node Program Manager