Answer the question
In order to leave comments, you need to log in
How to use require in nodejs like require in PHP?
I need the require function to work like in PHP
Answer the question
In order to leave comments, you need to log in
So that the code is simply "copied" as in PHP and another file can see and use the variables of the current file? No way.
In a node, files are modules in which there are no other environments than their own.
the request function in the node works as it should. if you came to a node with php, you can safely turn around and go back, because a good code may not work out.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question