I have some functions inside a file. I'm trying to obtain all functions in that file, from within that file. Normally, all functions are in the window
object, but I'm using Node.js, which does not seem to have a window
object.
Say I have something along the lines of the following in a file:
function foo() {}
function bar() {}
then:
- Are the functions saved in some global object?
- If not, how can I access these functions without knowing their names? Can I iterate through all existing functions and obtain them in such a way?