A custom module is a JavaScript file created by the programmer and reused in another Node.js file.
math.js
function add(a, b) {
return a + b;
}
module.exports = add;
app.js
const add = require("./math");
console.log(add(10, 20));