I have a very basic function that looks like this, it is in a file called functions.js
function echo(input){
process.stdout.write(echo);
}
When I add the file and call echo()
like so:
Main file:
require(functions.js);
require(another_file.js);
another_file.js
echo(hello!);
It is giving me the following error:
ReferenceError: echo is not defined
Is there a way for me to make a function that is global like that without havingin to use exports
?