Learning How To Code With Node Flashcards

1
Q

What is node.js and how is it important for improving application?

A

It is server side language that helps build high and scalable application which will make it faster

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

What is a console?
How is it used in node.js

A

It is a module that helps in debugging application,it makes use of require(‘’)

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

List the console keywords used in debugging with node.js

A

Console.log: used for debugging and others
Console.assert: it decides if a statement is true
Console.timeEnd: determines the time used to perform a command
Console.debug: used for debugging specifically.

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

What is the command to execute multiline statement in node.js

A

Ctrl + D is used after initiating a multiline statement by tapping on the enter button twice

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

What does REPL stands for and how is it done

A

R - read, E - evaluate, P - print, L - loop this is the basic cycle of how node.js works,it is a snippet that makes an accurate and efficient way of debugging and running codes

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

What is Npm and the list of it commands

A

Node package modules is a developer tools that helps make libraries and dependencies available for developers to use which cam be an open source or paid one to be implemented in your node.js projects
List of Npm commands;
Npm init - starts a node project
Npm install - installs all dependencies listed in package.json file
Npm ls - shows list of all dependencies
Npm audit - fixes and checks for problem and gives a report
Npm update - updates the dependencies
Npm uninstall - uninstall all dependencies
Npm search “keywords” - searches for the keyword given
Npm install –save “package” : installs and then saves it to dependencies

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

List some global object and their highlight

A

Console - for debugging
Globals - for making it accessible over different modules
_filename
_dirname

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

What is os module and list it functions?

A

It is a module that provides set of functions for interacting with the operating system
Os.freemem()
Os.totalmem()
Os.platform()
Os.tmpdr()
Os.type()
Os.runtime()

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

List and explain the time object?

A

setTimeOut() - execute after the time for delay
setTimeInterval() - repeatedly executes a function after specific time
Process.nextTick() - runs a function right after the current function is executed but before the loop ends
setImmediate() - immediately after the current function is run

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

How does DNS modules work?

A

First you have to import the domain name service(DNS) module using the require keyword and it is a module for performing network resolution task

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

List the DNS modules and the argument passed in the callback function?

A

DNS.lookup() - it resolves the domain name by passing the domain name and callback function that takes in two argument the domain name and the address passed with a template literal.
DNS.reverse() - it performs a reverse of the lookup which uses the IP address and hostname.
DNS.resolve() - it resolves the service

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