I decided to use RequireJS as my module loader in NodeJS.
Unfortunately, the modules I define don't have access to some of the "global" objects that would be be available if the modules were loaded using the CommonJS method. This includes the objects that are located in the module scope, such as __dirname
and __filename
.
Is there a relatively simple approach to using these objects in the RequireJS modules?