Skip to main content

Node Study Questions

  1. What is Node.js?

    • Node.js is an asynchronous, event-driven JavaScript Runtime environment.
  2. Explain callback in Node.js.

    • A callback function is called after a given task. It allows other code to be run in the meantime and prevents any blocking. Being an asynchronous platform, Node.js heavily relies on callback. All APIs of Node are written to support callbacks.
  3. How is Node.js most frequently used?

    • Node.js is widely used for real-time chats, internet of things, complex single-page applications, real-time collaboration tools, streaming applications, and microservices architecture.
  4. What are the modules in Node.js?

    • Modules are like JavaScript libraries that can be used in a Node.js application to include a set of functions. To include a module in a Node.js application, use the require() function with the parentheses containing the module's name.
  5. What is the command that is used in node.js execute/run a file?

    • Use the node cli to run a file
    • Example:
    node path/to/file/index.js
  6. What is Express.js?

    • Express.js is a popular server framework built on Node.js for creating HTTP and HTTPS servers with routing and middleware.

Study More#