Answer the question
In order to leave comments, you need to log in
How to use the same function for both export and run directly through the console with parameters?
How to use the same function, placed in a separate file (module), both for export and for launching directly through the console with parameters?
Let there be a file called mod.js like
const func = (arg) => console.log( arg + 1 )
module.exports = func
node mod func 5
6
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question