Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question: comparing this with app-module-path-node #1

Open
alessioalex opened this issue Sep 28, 2016 · 1 comment
Open

question: comparing this with app-module-path-node #1

alessioalex opened this issue Sep 28, 2016 · 1 comment

Comments

@alessioalex
Copy link

Hey there, I was wondering when should I use this module over the other? In my project I'm only looking to require stuff from the root, so I won't be needing another folder besides that for quick access. Should I just use require-self-ref instead? I think it would be more transparent as to where I require the modules from, compared to app-module-path-node. Thanks.

@patrick-steele-idem
Copy link
Owner

I feel like require-self-ref is strictly better than app-module-path and am recommending it going forward. The biggest advantage of require-self-ref is that it relies on a special symbol at the beginning of the target path and this makes the whole solution less of a hack. Of course, I would love to see the Node.js module loading system adopt the require-self-ref approach natively, but I don't think that will happen because they have locked the native module loading system, but who knows...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants