Node General Flashcards

1
Q

What is the purpose of module.exports in a Node.js module?

A

allows to specify which functions/variables should be exported to be used in other files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you import functionality into a Node.js module from another Node.js module?

A

require()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a directory?

A

Container that stores files and other directories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a relative file path?

A

Starts from the directory you’re in to your file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an absolute file path?

A

Starts from root all the way to your file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What module does Node.js include for manipulating the file system?

A

fs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What method is available in the Node.js fs module for writing data to a file?

A

writeFile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Are file operations using the fs module synchronous or asynchronous?

A

asynchronous

How well did you know this?
1
Not at all
2
3
4
5
Perfectly