Node.js Flashcards
1
Q
run a node application in Command Line
A
node app.js
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
3
Q
where can you find node.js documentation
A
nodejs.org
4
Q
.on method
A
a method that is responding to an event (used a lot in node.js)
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
6
Q
what do you need to do divide up the JSON into an object?
A
Parse!
JSON.parse(text)
7
Q
return character in node
A
\n
8
Q
return character in node
A
\n
9
Q
setInterval()
A
allows you to do something repeatedly over a set interval. ex: setInterval(function(){ response.write(new Date() + "\n"); }, 1000);
10
Q
local IP address for all local computers
A
127.0.0.1