Node.js Flashcards

1
Q

What is a CLI?

A

Command-line interface- using text input to execute commands

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

What is a GUI?

A

Graphical user interface- interface that allows user to interact with devices with graphical icons (or audio indicators)

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

Give at least one use case for each of the commands listed in this exercise.

A
  • man- look up system reference manuals, which can be looked up by specific section
    • cat- concatenate files together and printing them
    • ls - list information about files (contents of the current directory), like a list of names
    • pwd - print name of current directory, tells whole path to the directory
    • echo - display a line of text, you can add that text as a new file
    • touch- update file timestamps to the current time
    • mkdir - make new directories; create child directories or nest directories
    • mv- move files, rename files
    • rm- delete files or directories
    • cp- copy files and directories
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the three virtues of a great programmer?

A
  1. Laziness: The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful and document what you wrote so you don’t have to answer so many questions about it.
  2. Impatience: The anger you feel when the computer is being lazy. This makes you write programs that don’t just react to your needs, but actually anticipate them. Or at least pretend to.
  3. Hubris: The quality that makes you write (and maintain) programs that other people won’t want to say bad things about.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Node.js?

A

Program that allows javascript to be run outside of a web browser

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

What can Node.js be used for?

A

Building back-end applications and command line programs. Or any type of automation developers wish to perform. Can build WEB SERVERS.

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

What is a REPL?

A

Read, evaluate, print, loop
Programming environment that takes user inputs, executes them, and returns the results to the user, then loops

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

When was Node,js created?

A

2009

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

What back end languages have you heard of?

A

Python, C++, C, Java

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

What is a computer process?

A

An instance of a computer program

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

Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?

A

250

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

Why should a full stack Web developer know that computer processes exist?

A

Full stack development is based on having multiple processes work together at the same time to deliver a working application

Another reason is so you can kill a process if needed

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

What is theprocessobject in a Node.js program?

A

A global object that provides information about, and control over, the current Node.js process.

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

How do you access theprocessobject in a Node.js program?

A

just typing process

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

What is the data type ofprocess.argvin Node.js?

A

An array of command line arguments (string) from when the Node.js process was launched.

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

What is a JavaScript module?

A

A single .js file

17
Q

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

A

__dirname -directory name of current module
__filename - file name of current module
Exports - reference to module.exports
Module - reference to the current module - string for module name or path
Require-returns any exported module content

18
Q

Give two examples oftrulyglobal variables in a Node.js program.

A

Process
Console

19
Q

What is the purpose ofmodule.exportsin a Node.js module?

A

To allow you to export a files functionality only when its needed

20
Q

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

A

require()

21
Q

What is a directory?

A

A folder or files that contains other files

22
Q

What is a relative file path?

A

Location of a file in relation to the current working directory
./ -> current directory
../ -> parent directory

23
Q

What is an absolute file path?

A

Location of a file from the root directory

24
Q

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

A

‘fs’