wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Nodejs Core Modules

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

A path is a specific way to locate ___ or ___ within the system hierarchy

a)

extension or directory

b)

file or directory

c)

file or extension

d)

directory or folder

2.

______ provides the complete location of a file or directory starting from the root of the file system

a)

absolute path

b)

relative path

c)

home path

d)

root path

3.

_____ specifies the location of a file or directory relative to the current working directory

a)

absolute path

b)

relative path

c)

home path

d)

root path

4.

Choose the correct option for root in file systems

a)

Linux/macOs === "\"
Windows === "/"

b)

Linux/macOs === "C:/"
Windows === "/"

c)

Linux/macOs === "/"
Windows === "C:\"

d)

Linux/macOs === "/"
Windows === "\"

5.

The root of a file system is _____

a)

The highest-level directory in the directory hierarchy

b)

The lowest-level directory in the directory hierarchy

c)

The entry-level directory in the directory hierarchy

d)

The current-level directory in the directory hierarchy

6.

Which of these modules allow NodeJs applications interact with and gather information about the underlying operating system on which the Node.js runtime is running?

a)

path

b)

process

c)

fs

d)

os

7.

Which of these modules is responsible for providing a way to interact with the current NodeJs process running the application.

a)

os

b)

fs

c)

path

d)

process

8.

To get the environment variables running in a process, which of the following is correct:

a)

process.vars

b)

process.env

c)

process.environs

d)

process.envars

9.

'node app.js name daniel'
What would be the output of process.argv[2]

a)

node

b)

app.js

c)

name

d)

daniel

10.

One of the following exits a running Nodejs process?

a)

process.quit()

b)

process.close()

c)

process.exit()

d)

process.stop()

11.

What is the full meaning of fs

a)

file system

b)

file sync

c)

folder setup

d)

folder settings

12.

One of the following is NOT possible with the fs module

a)

create, read and update file or directory

b)

open file or directory

c)

sync file or directory

d)

delete file or directory

13.

Most, if not all functions in the fs module have asynchronous and synchronous methods

a)

True

b)

False

c)

I don't know

d)

none of the options

14.

Which of the following methods will read the content of a file asynchronously

a)

fs.read()

b)

fs.readFile()

c)

fs.readFileAsync()

d)

fs.readfile()

15.

Using the http module, what is the correct method for creating a server

a)

http.server()

b)

http.startServer()

c)

http.createServer()

d)

http.listen()