Search Header Logo

node day02

Authored by Gnanavel Durairaj

Other

Professional Development

Used 4+ times

node day02
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

27 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does require() do in Node.js?

Defines a module

Loads a module

Deletes a module

Compiles a module

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to export functions in Node.js?

export

exports

module.exports

define

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When using module.exports, what happens if we assign a new object directly?

It overrides the previous object

It merges with the existing object

It adds a new property to exports

It causes an error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you import a local module named utility.js?

import 'utility.js'

require('./utility')

include 'utility.js'

module.load('utility.js')

5.

FILL IN THE BLANK QUESTION

1 min • 1 pt

What is the default encoding for fs.readFile()?

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write to a file without overwriting its content?

fs.writeFile(filename, data)

fs.appendFile(filename, data)

fs.addFile(filename, data)

fs.saveFile(filename, data)

7.

FILL IN THE BLANK QUESTION

1 min • 2 pts

Which function checks if a file exists?

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?