There are two modules (using es6 syntax)
Module 1
exports.someFunc = function () { return someVar; } Module 2
let Module1 = require("Module1.js"); let someVar = 10; console.log( Module1.someFunc() ); /* Выбрасывает ошибку, что someVar не определена*/ Is it possible to somehow make the function of the first module see the local variables of the second module ?
PS Passing a variable as a parameter of the function of the first module is not very suitable
In reality, the first module is a list of functions that are called in the second module .
(There are a lot of functions, so I decided to put them in a separate module).
func(var1, var2, var3... varN)I will try the Olson-a option - ThisMan