UNPKG

modikrishpackage

Version:

39 lines (33 loc) 892 B
function add(a, b) { console.log("Adding numbers: " + (a + b)); return a + b; } function sub(a, b) { console.log("Subtracting numbers: " + (a - b)); return a - b; } function multiply(a, b) { console.log("Multiplying numbers: " + (a * b)); return a * b; } function divide(a, b) { if (b === 0) { console.log("Error: Division by zero is not allowed."); return null; } console.log("Dividing numbers: " + (a / b)); return a / b; } function CurrentDateTime() { console.log("Current Date and Time: " + new Date()); return new Date(); } module.exports = { add: add, sub: sub, multiply: multiply, divide: divide, CurrentDateTime: CurrentDateTime }; console.log("Module loaded successfully."); console.log("Available functions: add, sub, multiply, divide, CurrentDateTime");