Modules

Export Function: In another server JavaScript file, export a function:
module.exports.yourFunction = () => {
  // your code here
}
Import File: At the top of index.js, import the the other file:
let yourModule = require(`./other-file.js`)
Call Function: In index.js, call the function from the imported file:
yourModule.yourFunction()