In Node.js a module encapsulate all related codes into a single unit code that can be parsed by moving all relevant functions into a single file. You may export a module with the module and export the function which lets it be imported into another file with the needed keyword.