Exambodh - योग्यता, रीजनिंग और GK प्रश्नों का अभ्यास
UPlay Quiz
साक्षात्कार अभ्यास
MediumQ. No. what-is-the-purpose-of-module-exports

module.exports का उद्देश्य?

Last Updated:

Amodules import
Bmodule से functions/objects export करना
Cmodules delete
Dmodules create
Correct Answer: module से functions/objects export करनाYour Answer: B

Explanation

module.exports Node.js module से functions या objects export करने के लिए उपयोग होता है।

Important Notes

  • Modules
यह सामग्री अभी उपलब्ध न...
साक्षात्कार...
Answer
module से functions/obj...

Exam Info

  • Asked in: SSC, Railway, Banking and other competitive exams.
  • Also asked in: RRB NTPC, CHSL, State PCS and online mock tests.
  • Topic: यह सामग्री अभी उपलब्ध नहीं है।

Related Questions

View All

FAQ

यह सामग्री अभी उपलब्ध नहीं है। FAQs

Common questions and clear answers for this topic.

What is Node.js and what makes it different from browser JavaScript?

Node.js is a JavaScript runtime environment built on Chrome's V8 engine that allows JavaScript to run on the server side. Key features: non-blocking asynchronous I/O, event-driven architecture, single-threaded with event loop, npm (Node Package Manager) with millions of packages. Node.js is used for building REST APIs, real-time applications, streaming services, and microservices.

What is npm and what is the purpose of package.json?

npm (Node Package Manager) is the default package manager for Node.js. package.json is the project manifest file that contains: project name and version, list of dependencies (packages the project needs), devDependencies (tools for development), and scripts (npm run commands). npm install reads package.json and installs all dependencies in the node_modules folder.

What is the difference between require() and import in Node.js?

require() is CommonJS module syntax used in older Node.js versions. It is synchronous and loads modules at runtime. import/export is ES Module syntax, statically analyzed at compile time, and supports tree-shaking. To use ES Modules in Node.js, add type: module in package.json or use .mjs extension. Modern Node.js supports both, but many packages still use CommonJS.

What is Express.js and how is it used with Node.js?

Express.js is the most popular web framework for Node.js that simplifies building RESTful APIs and web applications. It provides: routing (GET, POST, PUT, DELETE), middleware support, template engines, error handling, and static file serving. Express is minimal and unopinionated, making it flexible for building any type of Node.js application. It is the most widely used Node.js framework.

What is the Node.js Event Loop and how does it handle asynchronous operations?

The Node.js Event Loop allows Node.js to perform non-blocking I/O operations despite JavaScript being single-threaded. When async operations (file read, database query, HTTP request) are initiated, they are delegated to the OS or thread pool. When complete, callbacks are placed in the event queue. The event loop processes callbacks when the call stack is empty, enabling handling thousands of concurrent connections.