Answer the question
In order to leave comments, you need to log in
Calling a function from a file in node js?
There is a file with content
import {} from ....
import {} from ....
import {} from ....
export const func = [
{
fname: 'тест функ',
func: (contract) => {
console.log('1')
}
},
},
{
fname: 'тест функ2',
func: (auto) => {
console.log('2')
}
},
}]
Answer the question
In order to leave comments, you need to log in
It's not entirely clear why you want to use the "fs"
module to include modules .
To connect in NodeJS you can use
const myScript = reqiure("./index.js");
const config = myScript.getConfig();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question