// Exporting a function from a module in Node.js
// Step 1: Define the function in the module file (e.g., myModule.js)
const myFunction = (param1, param2) => {
// Function logic here
return result;
};
// Step 2: Export the function using module.exports
module.exports = myFunction;
// Step 3: Import the module and use the exported function in another file (e.g., main.js)
const myFunction = require('./myModule');
// Step 4: Call the exported function with appropriate arguments
const result = myFunction(arg1, arg2);
// Result can now be used as needed