1. what is node.js node.js is a popular scripting lang primarily used for server-side scripting requirements numerous benefits one being non-blocking i/o ->mailny used to perform non-blocking activities
  2. can you briefly explain the working of node.js
    1. node.js is an entity that runs in a virtual environment, using javascript as the primary scripting language.
    2. it uses v8 engine to perform non-blocking i/o and single threaded event loop
  3. where is node.js used
    1. almost everywhere
    2. network applications
    3. distributed computing
    4. responsive web app
    5. server-client architecture
  4. node.js vs angular
    1. scalability is required→node.js,
    2. real-time app → angular
  5. why is node.js single-thread app
    1. node.js use single thread just to ensure that there is support for asynchrounous process
    2. with it it make it scalable and efficient
  6. different api supported by js
    1. synchronous : for blockign
    2. asynchronous fornon- blocking
  7. synchronous vs asynchronous
    1. Async is non-blocking, which means it will send multiple requests to a server. Sync is blocking — it will only send the server one request at a time and wait for that request to be answered by the server. Async increases throughput because multiple operations can run at the same time.
  8. what is event loop*
    1. call backs need to be handled,
    2. event loops are used for this purpose,
    3. since node.js supports the non-blocking.
    4. The Event Loop monitors the Call Stack and the Callback Queue, ensuring that callback functions are executed once the Call Stack is empty. This enables JavaScript to manage and execute asynchronous operations efficiently while maintaining its single-threaded nature
  9. what are the asynchronous tasks that should occur in an event loop
    1. blocking send requests
    2. high computational requirement
    3. real-time i/o operations
  10. what are there any disadvantages to using node.js
    1. relational databases, multi-threaded platform
  11. what is the prmary reason to use the event-bases model in node.js
    1. the event-based model in node.js is used to overcome the problems that occur when using blocking operations in the i/o channel
  12. ajax and node.js
    1. executes in browser →ajax
    2. executes on the server →node.js
  13. what is the use of middleware in node.js
    1. middleware is a simple function that has the ability to handle incoming requests and outbound response objects
  14. whar are global objects in node.js
    1. global objects are objects with a scope that is accessible across all of the modules of the node.js application.
  15. why is express Js is widely used
    1. lightweight and flexible, express.js
    2. management point that controll data between servers and server-side applications.
  16. streams
    1. streams aree a set of data entities in node.js these considered similar to the working of strings and array objects
  17. repl in node.js
    1. repl → read eval print loop
    2. virtual enviroment to test javascript code in node.js
    3. directly in command line by just typing “node”
  18. package.json
    1. one metadata file → file contain information about other file
  19. readfile vs createreadstream
    1. contents of given file will be read in asycnhronous manner
    2. create readstream → break up the field into smaller chunks and then read it.