Answer the question
In order to leave comments, you need to log in
How to add your own folder to search for modules?
How to add your own folder to search for modules? to require, first searched among the modules in myModules and then in node_modules.
you can do this in 1 file if you add your path to module.paths, but how to do it globally?
Answer the question
In order to leave comments, you need to log in
module is not a global object, it is a parameter of the wrapper function that wraps your file before execution, it is considered absolutely normal to include libraries by their name, and any project files along the path. if you have a desire to include part of your code by name, your task is to prepare such code as a package,
any deviation in this matter can lead you to a charming r-code, which will cost you dearly in the future.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question