3 Program to use Modules in NodeJS Atharva Satyendra Agrawal August 11, 2020 Atharva Satyendra Agrawal Program: square.js: var calculate_square = function(number){ console.log(number*number); } module.exports = calculate_square; app.js: var calculate_square = require('./square') calculate_square(5) Output: Tweet Share Share Share Related Post