Node.js Flashcards

1
Q

run a node application in Command Line

A

node app.js

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

how to play around with an application right in the console

A

node (enter)
then you can define variable and functions/objects etc.
type “control” + “c” twice to get out of this mode

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

where can you find node.js documentation

A

nodejs.org

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

.on method

A

a method that is responding to an event (used a lot in node.js)

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

if there is an error thrown, how will i know?

A

oftentimes there will be an error event shown in the console -
unhandled ‘error’ event

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

what do you need to do divide up the JSON into an object?

A

Parse!

JSON.parse(text)

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

return character in node

A

\n

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

return character in node

A

\n

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

setInterval()

A
allows you to do something repeatedly over a set interval.  ex:
setInterval(function(){
    response.write(new Date() + "\n");
  }, 1000);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

local IP address for all local computers

A

127.0.0.1

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