Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/01/18 in Posts

  1. Well, module.exports = { myfunc: function (a,b){ return a*b; }, otherfunc: function (a,b){ return a/b; }, } let Functions = require('"path to functions.js"/functions.js'); Object.assign(global, Functions); // myfunc() and otherfunc() are simply added to the global object and can be used everywhere // you can also use: global.Functions = require('"path to functions.js"/functions.js'); // Functions.myfunc() and Functions.otherfunc() are added to the global object and can be used everywhere
    1 point
×
×
  • Create New...