node-module-system Flashcards

1
Q

What is a JavaScript module?

A

a single .js file

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

What values are passed into a Node.js module’s local scope?

A

exports, require, module, __filename & __dirname

exports: how this module and function can pass functionality and values to other modules

require: how this module and function can pull in functionality and values to other modules

__filename gives you the file name
__dirname fives you the directory

these 5 are how modules are able to communicate w other modules

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

Give two examples of truly global variables in a Node.js program.

A

console and process

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