Learning How To Code With Node Flashcards
What is node.js and how is it important for improving application?
It is server side language that helps build high and scalable application which will make it faster
What is a console?
How is it used in node.js
It is a module that helps in debugging application,it makes use of require(‘’)
List the console keywords used in debugging with node.js
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.
What is the command to execute multiline statement in node.js
Ctrl + D is used after initiating a multiline statement by tapping on the enter button twice
What does REPL stands for and how is it done
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
What is Npm and the list of it commands
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
List some global object and their highlight
Console - for debugging
Globals - for making it accessible over different modules
_filename
_dirname
What is os module and list it functions?
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()
List and explain the time object?
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 does DNS modules work?
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
List the DNS modules and the argument passed in the callback function?
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