Command Line / Node.js Flashcards

1
Q

What is a CLI?

A

Command-line interface - a form of user interface that processes commands to a computer program in the form of lines of text

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 - a form of user interface that allows users to interact with electronic devices through graphical icons instead of text-based user interfaces

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

What does the man command do?

A

displays manual for command information

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

What does the cat command do?

A

concatenate files and prints to the command prompt

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

What does the ls command do?

A

list directory contents

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

What does the pwd command do?

A

print name of the current/working directory

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

What does the echo command do?

A

display a line of text

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

What does the touch command do?

A

create an empty file; change file timestamps

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

What does the mkdir command do?

A

make directories

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

What does the mv command do?

A

move/rename files or directories

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

What does the rm command do?

A

remove files or directories

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

What does the cp command do?

A

copy files and directories

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

What are the three virtues of a great programmer?

A

laziness, impatience, hubris

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

What is Node.js?

A

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
15
Q

What can Node.js be used for?

A

to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform

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

What is a REPL?

A

Read–eval–print loop: a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user

17
Q

When was Node.js created?

A

2009

18
Q

What back end languages have you heard of?

A

Python, Ruby, Java, PHP

19
Q

What is a computer process?

A

the instance of a computer program that is being executed by one or many threads

20
Q

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

A

8

21
Q

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

A

Full stack Web development is based on making multiple processes work together to form one application

22
Q

What is the process object in a Node.js program?

A

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

23
Q

How do you access the process object in a Node.js program?

A

just type process

24
Q

What is the data type of process.argv in Node.js?

A

array

25
Q

What is a JavaScript module?

A

a single .js file

26
Q

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

A

__dirname, __filename, exports, module, require( )

27
Q

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

A

console, process

28
Q

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

A

functions can be assigned to module.exports - makes them available to other modules by calling require( )

29
Q

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

A

const variableName = require( ‘./fileName );

30
Q

What is the JavaScript Event Loop?

A

a concurrency model that is responsible for executing the code, collecting and processing events, and executing queued sub-tasks

31
Q

What is the difference between “blocking” and “non-blocking” with respect to how code is executed?

A

blocking code sits on the stack until it is executed, while non-blocking code is pushed off onto the task queue to be executed later

32
Q

What is a directory?

A

structure of a file system that stores files

33
Q

What is a relative file path?

A

location of a file/directory relative to the current file/directory

34
Q

What is an absolute file path?

A

full URL to a file

35
Q

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

A

fs.writeFile( )

36
Q

Are file operations using the fs module synchronous or asynchronous?

A

asynchronous (unless explicitly using the sync fs methods)