module.exports.yourFunction = () => { // your code here }
index.js
let yourModule = require(`./other-file.js`)
yourModule.yourFunction()